Skip to content

Instantly share code, notes, and snippets.

0-mail.com
0815.ru
0845.ru
0clickemail.com
0wnd.net
0wnd.org
10mail.com
10mail.org
10minutemail.cf
10minutemail.co.za
@Mad182
Mad182 / twitter_test.php
Created November 21, 2012 13:03 — forked from skakri/twitter_test.php
Twitter streaming API + URL unshortening
<?php
/**
* Unshorten links
*
* @param string $text
* @return string
*/
function unshorten_links($text) {
$pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#';
$callback = create_function('$matches', '