View Single Post
Old 02-09-2020, 03:41 PM   #3
pacha2
Member
pacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterpacha2 can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
pacha2's Avatar
 
Posts: 18
Karma: 12710
Join Date: Feb 2020
Device: Kindle Paperwhite
Thanks for the reply. I did have those, but the old import seem to break the standard recipe.
The old code snippets I copied and pasted seemed to cause more issue for me.

I the code working now, and I have pasted it below.
I modified the
It grabs the latest paper front page for either The Guardian and The Observer.

Code:
import urllib2
from datetime import date, timedelta
from bs4 import BeautifulSoup

def twitter_front_page():
        basedate = date.today() - timedelta(days=2)
        baseurl = 'https://mobile.twitter.com/search?q=front%20page%20%20%28from%3Aobserveruk%20OR%20from%3Aguardian%29%20since%3A' + str(basedate)
        data = urllib2.urlopen(baseurl)
        html = BeautifulSoup(data, 'html.parser')
        media = html.find(class_="media")
        img = media.find('img')
        twitter_cover = img.get('src') 
        return twitter_cover

    cover_url = twitter_front_page()
pacha2 is offline   Reply With Quote