Twitter URL encoding

Posted by Rich on Stack Overflow See other posts from Stack Overflow or by Rich
Published on 2009-12-14T20:21:36Z Indexed on 2010/06/16 21:22 UTC
Read the original article Hit count: 144

Filed under:
|
|

Hi,

We're about to launch a little twitter Christmas competition, and I've run into a little snag.

To enter, people will need to post a tweet in the following format:

@user blah, blah, blah #hashtag

Currently, I have a form where they enter their answer (the blah, blah, blah) and a PHP script which encodes the entire statement and adds on the twitter url:

http://www.twitter.com/home?status=%40user%20blah%2Cblah%2Cblah%20%23hashtag

Then takes the user to twitter and puts the status in the update field.

However, whilst the spaces (%20) are decoded fine the @ and # characters remain as %40 & %23 respectively, even when the tweet is posted. I cannot put the actual characters in the url as twitter mistakes this for a search.

Is there any way to solve this? I'd like to do it without requiring username & password etc if possible.

Any help will be greatly appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about url