codelucas/newspaper — pull request #28 by voidfiles (2014-01-27 00:33:04+00:00)
Title: Extract Meta Tags in structured way

There is a lot of meta data that poeple put in meta tags. Espcially
when you realize that Open Graph, and Twitter Cards are very popular.
Therefore I suggest that should be a way to extract the tags from
an article.

Here is an example:

```sh
import newspaper
article = newspaper.build_article('http://www.buzzfeed.com/tabirakhter/epic-literary-love-tattoos')
article.download()
article.parse()
print pprint.pformat(dict(article.meta_data))

{'article': {'publisher': 'https://www.facebook.com/BuzzFeed',
'section': 'DIY',
'tag': 'Tattoos'},
'og': {'description': 'All is fair in love and ink.',
'image': {'height': 625,
'url': 'http://s3-ak.buzzfeed.com/static/2014-01/enhanced/webdr06/22/16/enhanced-buzz-8304-1390426280-19.jpg',
'width': 625},
'site_name': 'BuzzFeed',
'title': '23 Epic Literary Love Tattoos',
'type': 'article',
'url': 'http://www.buzzfeed.com/tabirakhter/epic-literary-love-tattoos'},
'twitter': {'app': {'id': {'googleplay': 'com.buzzfeed.android',
'ipad': 'id352969997',
'iphone': 'id352969997'},
'url': {'googleplay': 'http://www.buzzfeed.com/tabirakhter/epic-literary-love-tattoos'}},
'card': 'summary_large_image',
'creator': '@tabooradley',
'description': 'All is fair in love and ink.',
'image': 'http://s3-ak.buzzfeed.com/static/2014-01/campaign_images/webdr06/26/14/23-epic-literary-love-tattoos-1-1410-1390763440-3_big.jpg',
'site': '@buzzfeed',
'title': '23 Epic Literary Love Tattoos',
'url': 'http://www.buzzfeed.com/tabirakhter/epic-literary-love-tattoos'}}
```