Using PHP and the API for Twitter URL shortening

13 views
Skip to first unread message

SolSystem

unread,
Aug 10, 2010, 8:22:38 PM8/10/10
to awesm-api
I'm creating an app for my company that updates twitter whenever we
post a new news item on our site. I've got the Twitter API code
working for that but now I want to incorporate my custom URL
shortener. I've read through the awesm-api docs, in particular the
example using PHP and cURL. That's a good example however it returns
everything from the request into $awesm-request_response. I only want
to return the new created $awesm_url. Any ideas?

Thanks
Marc

Jonathan Strauss

unread,
Aug 10, 2010, 8:25:48 PM8/10/10
to awes...@googlegroups.com
Hi Marc,

If you use the http://create.awe.sm/url.txt endpoint (instead of /url.xml as in the PHP example), it will just return the awesm_url as a text field.

Feel free to send me any code snippets if we can be of any further help trouble-shooting.

Best,
-jonathan

--
Jonathan Strauss, Co-Founder
http://snowballfactory.com

Campaign tracking for social media - http://awe.sm
A smarter way to update Facebook from Twitter - http://tweetpo.st
Sharecount button for Facebook - http://www.fbshare.me

> --
> You received this message because you are subscribed to the Google Groups "awesm-api" group.
> To post to this group, send email to awes...@googlegroups.com.
> To unsubscribe from this group, send email to awesm-api+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/awesm-api?hl=en.
>

SolSystem

unread,
Aug 10, 2010, 8:29:46 PM8/10/10
to awesm-api
That did the trick. Works like a charm. Now I have just have to
incorporate into the rest of my code.

Thanks for the quick response.

On Aug 10, 8:25 pm, Jonathan Strauss <jonat...@snowballfactory.com>
wrote:
> Hi Marc,
>
> If you use thehttp://create.awe.sm/url.txtendpoint (instead of /url.xml as in the PHP example), it will just return the awesm_url as a text field.
>
> Feel free to send me any code snippets if we can be of any further help trouble-shooting.
>
> Best,
> -jonathan
>
> --
> Jonathan Strauss, Co-Founderhttp://snowballfactory.com
>
> Campaign tracking for social media -http://awe.sm
> A smarter way to update Facebook from Twitter -http://tweetpo.st
> Sharecount button for Facebook -http://www.fbshare.me
Reply all
Reply to author
Forward
0 new messages