opengraph icon indicating copy to clipboard operation
opengraph copied to clipboard

Duplicate data

Open raks8877 opened this issue 8 years ago • 3 comments

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/[email protected]', '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.

raks8877 avatar Feb 19 '17 13:02 raks8877

+1

OpenGraph isn't clearing the cached data each time.

n4ru avatar Feb 23 '17 21:02 n4ru

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

OpenGraph.__data__ = {}

n4ru avatar Feb 23 '17 21:02 n4ru

Thanks for the help.

raks8877 avatar Feb 24 '17 04:02 raks8877