Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
115
rated 0 times [  116] [ 1]  / answers: 1 / hits: 29339  / 11 Years ago, fri, october 11, 2013, 12:00:00

I'm making an application that retrieve tweets on Twitter of a user.



Those feeds contains links to external resources, such as Artciles, Webpage or YouTube video.



I get trought the Twitter API the JSON of these feeds, but there arent included the og: attributes of the content. And I'd like to catch them and show to my website.



Such as this question of StackOverflow:



<meta name=og:type content=website />
<meta name=og:image content=http://cdn.sstatic.net/stackoverflow/img/[email protected]?v=fde65a5a78c6/>
<meta name=og:title content=How can I check classes that ends with? />
<meta name=og:description content=I have some elements such as:
&amp;lt;div class=&quot;button 17-facebook-dashboard-check&quot;&amp;gt;Elem1&amp;lt;div&amp;gt;
&amp;lt;div class=&quot;button 18-google-dashboard-check&quot;&amp;gt;Elem2&amp;lt;div&amp;gt;
&amp;lt;div class=&quot;button />
<meta name=og:url content=https://stackoverflow.com/questions/19001883/how-can-i-check-classes-that-ends-with/>


I'd like to catch those informations for each shared resource on each tweet.
So I think I'll, for each tweet (which for me is a box) do an ajax request client side, download the html and parse it, retrieving og:title, og:description, og:type and og:image.



Is this the best approch? What's about parse this data in Javascript/Jquery?


More From » jquery

 Answers
8

These og: attributes are Open Graph Protocol attributes, there are many way to get these datas : you should check the codes of Open Graph Protocol parser which may be very usefull for you, and this PHP and jQuery Facebook link parser.



You can also check this StackOverflow Question about PHP parsing and this Opengraph PHP parser and dynamically use them with ajax calls.



Finally, this StackOverflow question about JQuery and pure JavaScript parsing is very interesting and could really help you.



Hope you'll find what you need ! ;)


[#75067] Thursday, October 10, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
johnnyblaynes

Total Points: 667
Total Questions: 121
Total Answers: 102

Location: Anguilla
Member since Sat, Jan 23, 2021
3 Years ago
johnnyblaynes questions
;