Embodiments provide functionality for extracting hyrdrocarbons from a subterranean formation. A fluid is provided and injected into a subterranean formation during a first period of time but not during a second period of time. At least part of the providing and injecting of the fluid is carried out using solar energy. Further, displaced hydrocarbons are collected from the subterranean formation.