Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Convert php permalink to short url?
Old 03-05-2009, 03:33 PM Convert php permalink to short url?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
I have this code that allows users to send a tweet from my blog:

Code:
<a href="http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>" title="Click to send this page to Twitter!" target="_blank">Tweet This!</a>
It works great, but I am trying to figure out how to have it convert the permalink to a short url, so the longer urls in my blog will work in Twitter (long urls get cut off). I know there is a wordpress plgin (tweet this) that has this feature, but I can't use that plugin for various reasons.

Thank you for any suggestions.
andrew99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-05-2009, 05:24 PM Re: Convert php permalink to short url?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Use the tiny URL API:

Code:
http://tinyurl.com/api-create.php?url=example.com
// Would return
http://tinyurl.com/1dqa
However, make sure you have WP-Super-Cache (or at least some method of storing the URLs) enabled, the API is a little slow.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 03-05-2009 at 05:26 PM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 03-05-2009, 07:05 PM Re: Convert php permalink to short url?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
rogem002 -Thanks for the help. I have some experience with php, but obviously not enough. I've been trying to get your suggestion into my code, but I can't seem to get it right. Any ideas of what a sample would look like?
andrew99 is offline
Reply With Quote
View Public Profile
 
Old 03-05-2009, 10:10 PM Re: Convert php permalink to short url?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
I finally found a good fix that's a little easier for me, and it works great: http://wpengineer.com/tweet-this-with-wordpress/
andrew99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Convert php permalink to short url?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46692 seconds with 12 queries