Getting my tweets on a web page via OAuth?


#1

Hi,

I used to be able to grab my tweets with a bit of AJAX and display them I on a webpage with whatever markup I want to use. Now I know you have to create an 'application’
then use some server side code to authenticate.

I did this and was able to retrieve a list of tweets into my console via Python (using Tweepy) but now I’m stuck as how to connect this server side code to my web page? I feel like I’m missing a vital step. Granted this is the first bit of Python of done, pass those results into my HTML. Can anyone help with some strategies?

P.S. I don’t wan’t to use the ‘widget’ as I need to do some really custom markup and css and the widget is too inflexible,

Thanks!
Jacob


#2

Either you render your webpage completely with python and the include the Tweets where you need them, but it seems you have not so much experience with this so that might not be a good solution.

A much easier way would be to just proxy the Tweet data using the python script, so that it returns the Tweet JSON, and you make a Ajax Request to it, and then render the JSON using JavaScript to your webpage in the way you need it.


#3

Thanks for the ideas. I’m already working in a CMS for this project so option 2 is where I’m heading…But I’m still a little stuck.

I know how to do the javascript side i.e.- to make a call to a REST API with a url that returns JSON and then looping through that data and adding to the DOM.

But I’m not sure how to make that ajax call to my python script. Can anyone shed any light on passing the json data from the python script to my javascript?

Thanks a bunch!