Energy harvesting from nanostructures