Go Down

Topic: Made my own TwitterClient and I think it's better than the example one (Read 14505 times) previous topic - next topic

kenneth87

#30
Sep 10, 2012, 08:47 am Last Edit: Sep 10, 2012, 09:40 am by kenneth87 Reason: 1
good day,

I realised once i run the code, when i update twitter while the code is running, it will not get updated to the latest tweet.

edit: got a fix to it! do you want me to share the code i have when i'm done? also fixed the part with the tweets broken into 16chars per line in a string like what you suggested.

JO3RI

I did see your previous post, but I didn't had the time to answer yet. Very nice you solved this yourself.

I would love to see your code, but you should get some credit yourself. Make a new post, showing off your own project (try to include a youtube movie or some pictures), just make a quick reference to this post, explaining you started using this code and adapted it, for you own project.
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

kenneth87

Good day JO3RI,

I am able to post the code soon as it is due for submission by start november. also my twitter client stopped working due to the recent API updates. do you have any idea what changes i have to make to enable it to start working again?

Twitter api version changed from v1.0 to v1.1

funkyguy4000

Accelerate to 88 miles per hour.

JO3RI

When I past this in my browser:

http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=JO3RI&count=1%20HTTP/1.1

replace JO3RI with your own twitter name if you like.

and if I try the same thing with hashtag search,

http://search.twitter.com/search.atom?q=%23arduino

I still get to see the last tweets, so mine is still working
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

kenneth87

yup mine is working too but when you use a code on Arduino IDE that uses GET HTTP, it doesn't seem to get tweets off twitter with that exact same line. any ideas?

also is there a way to implement oauth without going thru a PHP server?

JO3RI

I would give Arduino IDE 1.0 a try, the newer version seems to have other issues with my code (like dns)
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

kenneth87

i'm on arduino IDE 1.0! tested your code a while back. i could receive a weather update via xml but can't receive tweet updates via the same thing.

JO3RI

And you didn't change a thing? That's strange indeed. I could test your code on my own Arduino and network if you'd like.

Just attach your code to a reply and I'll give it a try. If it works on my end, you might have network issues. OR you might have set the interval to low so your Arduino is asking for updates way to fast and your IP got banned.
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

elHombreGer

Hi JO3RI,
I'm trying to do a Twitter client with Arduino (I want to receive tweets from an user account and display it on the serial monitor. I'm using an Arduino UNO R3 board and the Ethernet shield.
I have tested this example http://arduino.cc/en/Tutorial/TwitterClient and it works, but I have a problem: I'm Spanish, so there are some characters we use like letter 'ñ' and others like '¿' or '¡', etc., and the serial monitor doesn't show it. It shows "&#241" instead of 'ñ', "&#191" instead of '¿', "&#161" instead of '¡', etc. :(
Could you please help me to fix it? Do you have any idea of how I can solve it? Could your code help me to do it?
You'd be very helpful, really :)

JO3RI

Quote
Could you please help me to fix it? Do you have any idea of how I can solve it? Could your code help me to do it?
You'd be very helpful, really


are you able to show those characters on the serial monitor, when put into a string? (not from twitter, but when you just do Serial.print("those special characters"); ?

You can replace those &#241 , &#191, &#161 with the actual character. I did that in another project of mine (www.jo3ri.be/arduino/projects/castduino). You can start looking for &# with Textfinder and when found replace those with along with the according number.

Something like if &# and 241 than you have ñ.

also check google on "string replace" (http://www.cplusplus.com/reference/string/string/replace/)
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Anders 2009

Nice work and thanks for sharing!

I have been playing with a similar idea for control purposes, but never actually built any of it.

A trick I find could help a lot to simplify the on-board Arduino logic would be to put a service in-between the Arduino and the Twitter API to act as a proxy and format translator.

The idea would be that you can use the right tool for the right job. Calling a REST webservice, parsing the results and doing something with the data is a piece of cake in most "internet languages", like Java, JavaScript, Ruby or PHP. With a such a proxy in place, you could re-format the response from Twitter into something very Arduino-friendly to save valuable CPU and RAM. It would also give you a separation of concerns and provide a place to add more advanced features like caching of results and adding in more sources without having to change the Arduino program.

Hosting of the translator proxy could be done on a server of yours, or on an application hosting service like the examples below.
http://www.heroku.com/
or http://nodejitsu.com/

Anders

JO3RI

Quote
Nice work and thanks for sharing!


Thanks ;-)

Quote
The idea would be that you can use the right tool for the right job.


Good point, but sometimes it's just fun to have all in one solutions.
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Anders 2009



Code: [Select]
Good point, but sometimes it's just fun to have all in one solutions.

That is true and fun is one of the most important factors to consider. Why else would one have an Arduino hobby?


robtillaart

Quote
Why else would one have an Arduino hobby?

If you really want to know ask this in the bar sport section ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up