Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate data #28

Open
raks8877 opened this issue Feb 19, 2017 · 3 comments
Open

Duplicate data #28

raks8877 opened this issue Feb 19, 2017 · 3 comments

Comments

@raks8877
Copy link

raks8877 commented Feb 19, 2017

Ran these command in ipython:

from opengraph import OpenGraph
og=OpenGraph("http://www.livemint.com/Industry/VlSovF4AGkwhupYQ2Ps3YN/Bschool-placements-Modest-rise-in-average-salary-offered.html")
og

og=OpenGraph("http://facebook.com")
og

output1:
{'locale:alternate': 'ja_JP', 'site_name': 'http://www.livemint.com/', 'description': 'Initial analysis of the ongoing placement season at IIMs and other top B-schools indicate that most salaries offered show a single digit growth over last year', 'title': 'B-school placements see modest salary growth, fewer offers from start-ups', 'url': 'http://www.livemint.com/Industry/VlSovF4AGkwhupYQ2Ps3YN/Bschool-placements-Modest-rise-in-average-salary-offered.html', 'image': 'http://www.livemint.com/rf/Image-621x414/LiveMint/Period2/2017/02/08/Photos/Processed/iima-klWE--621x414@LiveMint.jpg', 'locale': 'hi_IN', 'type': 'article'}

output2:
{'locale:alternate': 'ja_JP', 'site_name': 'Facebook', 'description': 'Initial analysis of the ongoing placement season at IIMs and other top B-schools indicate that most salaries offered show a single digit growth over last year', 'title': 'B-school placements see modest salary growth, fewer offers from start-ups', 'url': 'https://www.facebook.com/', 'image': 'https://www.facebook.com/images/fb_icon_325x325.png', 'locale': 'hi_IN', 'type': 'article'}

description and title are same.

@n4ru
Copy link

n4ru commented Feb 23, 2017

+1

OpenGraph isn't clearing the cached data each time.

@n4ru
Copy link

n4ru commented Feb 23, 2017

As a workaround, you can manually reset the data object before you call it after the first time.

OpenGraph.__data__ = {}

@raks8877
Copy link
Author

Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants