I already have this plugin for youtube videos/vines/instagram etc but i'm struggling to get it to work with tweets.
PHP Code:
$embed_player = '
<table widht="300" align="center" class="tborder" >
<tr><td class="alt1">
<iframe src="[B]http://instagram.com/p/\\4/embed/[/B]" frameborder="0" width="280" height="330" scrolling="no"></iframe>
</td>
</tr>
</table>
';
$post['message'] = preg_replace('[B]#(<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'[/B], $embed_player, $post['message']);
I only need help with lines (src="
http://instagram.com/p/\\4/embed/")
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>
So all I really need to know is how to ignore the underlined part of a posted link and place it into this plugin, does that make sense?
sorry if this is so confusing im just a tad baffled at the mo!