Seems like TinyUrl is still too long... So I wrote wrapperclass to communicate with another url-shortening-service, called: bit.ly
Go grab your copy: http://classes.verkoyen.eu/bitly
Seems like TinyUrl is still too long... So I wrote wrapperclass to communicate with another url-shortening-service, called: bit.ly
Go grab your copy: http://classes.verkoyen.eu/bitly
Reacties
Pete schreef:
29/07/09
Y'know, your timing is perfect.
I just thought of integrating your Twitter class into a news posting system on one of our websites to automatically Tweet about news and was going to look at the bit.ly API docs and now I don't have to!
Thank you VERY much :)
Tijs schreef:
29/07/09
You're welcome
Paul Matthews schreef:
31/07/09
Hi
Think there may be a problem in the Twitter wrapper with using (int) to cast the $sinceId values, because the Twitter IDs are now past the maximum int size of 2 billion or so.
E.g. I was using getReplies, and think I have fixed the problem by casting the sinceId to a float instead of an int on line 612
Love the class BTW!
Paul
Tried to post this on your twitter API page, but got an error "something went wrong" !!
ian_scho schreef:
04/09/09
Thanks Tijs, will use your class if the basic file_get_contents doesn't work!
$url_final = "http://www.google.es";
$urlBitly = 'http://api.bit.ly/shorten?version=2.0.1&login=usernamehere&apiKey=R_longrandomstring=';
$output = file_get_contents($urlBitly . urlencode($url_final));
$json = json_decode($output, true);
if ($json && $json['errorCode'] == '0') {
$new_url = $json['results'][$url_final]['shortUrl'];
matt kaufman schreef:
07/01/11
thanks,
opposite can be made too to expand urls.