Author Topic: Echo'ing the latest tweet of a person  (Read 1516 times)

So I basically need a chunk of code that after executing will echo the latest tweet of @$name
Please?

I did this once but I don't have it anymore, sorry. Anyway, just look through the twitter API docs and use a TCPObject.

If you're asking people to write code for you, especially something like this that would require a decent amount of work, you'll want to post this in suggestions and requests
Coding help is typically used if you need help with some code you already have

Ok I have figured out this TCP object stuff and that I need to go to https://api.twitter.com/1.1/statuses/user_timeline/pefuXD.json?count=1?screen_name=pefuXD?include_rts=1 but it gives me error code 215 bad authentication data
I have my oauth consumer keys and all that stuff
Help

I believe the twitter API responds in JSON, so you'll probably need to use that JSON parser someone made. I think it was either Port or Destiny. I may be wrong, though.

JSON parser: http://forum.blockland.us/index.php?topic=213850.0

There are a couple more floating around as well.

How do I use that JSON parser? I download the json file from the twitter api page, then i use json_load("path/to/the/file.json"); and then json_loads("what do i put here"); ? but how do i execute that?
Sorry if I'm asking stupid questions but i don't really know how does the internet work :(

As of version 1.1 of the Twitter API you need to authenticate to view tweets of a person. That means you need to implement an OAuth client (as far as I know) in order to fetch tweets. So good look with that.

As of version 1.1 of the Twitter API you need to authenticate to view tweets of a person. That means you need to implement an OAuth client (as far as I know) in order to fetch tweets. So good look with that.

I actually have realized that, but how do i do that, do i send a special GET request or what

How do I use that JSON parser? I download the json file from the twitter api page, then i use json_load("path/to/the/file.json"); and then json_loads("what do i put here"); ? but how do i execute that?
Sorry if I'm asking stupid questions but i don't really know how does the internet work :(

json_load("actual json goes here, e.g. {foo: 5}");