The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Automatically embed tweet when user posts link (PHP)
I already have this plugin for youtube videos/vines/instagram etc but i'm struggling to get it to work with tweets.
PHP Code:
and (preg_replace('#(<a href="http://instagram.com)?/(embed/([-|~_0-9A-Za-z]+)|p\/([-|~_0-9A-Za-z]+)&?.*?)">(http://instagram.com)?/(embed/([-|~_0-9A-Za-z]+)|p\/([-|~_0-9A-Za-z]+)&?.*?)<\/a>#i') below is an example of a link a user would post https://twitter.com/greigeh/status/590850852161740801 but the script will run with the following html/javascript HTML Code:
<div> <script type="text/javascript"> function loadx(data) { document.write(data.html); } </script> <script type="text/javascript" src="https://api.twitter.com/1/statuses/oembed.json?id=[B]TWEET NUMBER HERE[/B]&callback=loadx"></script> <div class="twitter" onLoad="loadx().html"/> </div> </div> <div style="clear:both;"></div> sorry if this is so confusing im just a tad baffled at the mo! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|