The flow induced by the suitably timed growth and collapse of one or several bubbles in a finite tube joining two liquid reservoirs is simulated by a simple quasi-one-dimensional model. Viscous and surface tension effects are accounted for in an approximate manner. It is shown that, in certain parameter ranges, the system is capable of a net pumping action that moves the liquid from one reservoir to the other even in the presence of an adverse pressure difference. The fact that this net pumping effect is also encountered in the case of a single bubble, provided it is not located at the midpoint of the tube, is particularly remarkable. The mechanism responsible for this result is discussed. In practice the effect can be exploited to build a micropump by embedding electrical heaters in the wall of a small channel.