Integrals of automorphic forms and L-functions