Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 08-20-2014, 12:38 PM   #1
knowledgecrawler
Member
knowledgecrawler began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2014
Device: kindle
fetch article url from facebook feed

Hi,

I stumbled upon a hitch:-
How to extract article url from facebook feed?
There is a website which publishes the article and updates on facebook..

Here is the URL
https://www.facebook.com/feeds/page....6&format=rss20

How can we parse_feed to point the article to actual URL rather than the facebook URL?

knowledgecrawler is offline   Reply With Quote
Old 08-22-2014, 03:07 AM   #2
knowledgecrawler
Member
knowledgecrawler began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2014
Device: kindle
Thumbs up

Quote:
Originally Posted by knowledgecrawler View Post
Hi,

I stumbled upon a hitch:-
How to extract article url from facebook feed?
There is a website which publishes the article and updates on facebook..

Here is the URL
https://www.facebook.com/feeds/page....6&format=rss20

How can we parse_feed to point the article to actual URL rather than the facebook URL?

Finally got it..
Here's the code
PHP Code:
    def parse_feeds(self):
        
feeds BasicNewsRecipe.parse_feeds(self)
        for 
feed in feeds:
            for 
article in feed.articles[:]:
                
soup BeautifulSoup(article.summary)
                
soup.find("a")
                
url urllib.unquote(x["href"])
                
re.findall(r"(http://orfonline.*mmacmaid=\d*)"url)
                if 
m:
                    
article.url m[0]        
        return 
feeds 
This does the trick...

knowledgecrawler is offline   Reply With Quote
Reply

Tags
facebook feed, orf, url, url parsing, url rewrite

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URL, Twitter, Facebook, Goodreads tarisea Calibre 2 02-25-2014 07:12 PM
How to insert article URL? Mixx Recipes 4 01-09-2014 01:26 PM
Get article URL in postprocess_html rmflight Recipes 5 11-29-2012 11:37 AM
RSS feed with date in url entodoays Recipes 0 10-22-2011 04:24 PM
a feed that don't fetch, why? schuster Recipes 0 05-26-2011 02:53 PM


All times are GMT -4. The time now is 05:25 AM.


MobileRead.com is a privately owned, operated and funded community.