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.
I've had the same problem, and the solution was very simple.
Just usehttp://twitter.com/home?status=
instead ofhttp://www.twitter.com/home?status=
and it'll work as expected, even if the text isn't in ASCII.
If you want to know more details about this strange behavior see this blog post: http://www.kilometer0.com/blog/2010/01/21/twitter-status-urls-and-ampersands/
Hope this helps someone.
Encode the spaces as + and it works: http://twitter.com/home?status=%40user+blah%2Cblah%2Cblah+%23hashtag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With