TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack (1) Thread Tools Search this Thread Display Modes
Old 12-10-2007, 10:27 AM   #1 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 1,654
Thanks: 73
Wildhoney is on a distinguished road
Asterix Reverse TinyURLs

php Code:
function tinyurl_reverse($szAddress)
{
    $szAddress = explode('.com/', $szAddress);
    $szAddress = 'http://preview.tinyurl.com/'.$szAddress[1];
    $szDocument = file_get_contents($szAddress);
    preg_match('~redirecturl" href="(.*)">~i', $szDocument, $aMatches);
   
    if(isset($aMatches[1]))
    {
        return $aMatches[1];
    }
   
    return null;
}

echo tinyurl_reverse('http://tinyurl.com/388onbs');

Snazzy
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following 5 Users Say Thank You to Wildhoney For This Useful Post:
deflated (12-29-2007), Gurnk (12-10-2007), Haris (12-10-2007), Village Idiot (12-11-2007), webosb (01-01-2008)
Old 12-10-2007, 10:31 AM   #2 (permalink)
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 356
Thanks: 24
Haris is on a distinguished road
Default

Cool, now all we need is a library.
__________________
Necessity is the mother of invention.

My blog
Haris is offline  
Reply With Quote
Old 12-10-2007, 10:45 AM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 1,654
Thanks: 73
Wildhoney is on a distinguished road
Default

You do have a point I'll have to get onto it this week sometime.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 12-11-2007, 05:16 AM   #4 (permalink)
Moderator
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 684
Thanks: 15
Village Idiot is on a distinguished road
Default

Nice! (char limit)
__________________
There are two ways to write bug-free code, only the third one works.
Village Idiot is offline  
Reply With Quote
Old 12-29-2007, 05:52 AM   1 links from elsewhere to this Post. Click to view. #5 (permalink)
The Wanderer
 
deflated's Avatar
 
Join Date: Dec 2007
Location: 127.0.0.1
Posts: 18
Thanks: 7
deflated is on a distinguished road
Default

Quote:
Originally Posted by Haris View Post
Cool, now all we need is a library.
What sort of a library do you think of? A class with the ability to be extended by further link encryption services? If yes, I could contribute some functions but I'm still wondering about the legality of those decryption functions. There are services prohibiting the development and the usage of those 'tools'.
It's not that much work to develop such a class because they are quite simple. I think we only need one method which we pass the URL.

Regards,
Tim
deflated is offline  
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.talkphp.com/script-giveaway/1693-reverse-tinyurls.html
Posted By For Type Date
TalkPHP - Powered by vBulletin Post #5 Refback 12-29-2007 04:20 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:22 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0