S
S
S0ulReaver2012-01-28 14:20:10
Django
S0ulReaver, 2012-01-28 14:20:10

Django + Twitter - showcase latest posts

I understand that the question is simple, but alas - I need advice.

In general, the task is banal - the site has a block in which you want to show the last 3 posts from the blog on Twitter.

Well, let's say I take some popular Python library for Twitter, and pull out these 3 messages with grief in half. But the question is how and where to do it? Something tells me that receiving these 3 messages every time the site page is updated (taking into account authorization via oauth) is very expensive. Until authorization passes, until messages are received ... But there can be a lot of visitors. It comes to my mind to forget that the post from Twitter is always fresh, and just regularly receive these 3 posts, let's say every 5 minutes, but the site will already display them from some kind of database. Let's say ... But how to organize this download of messages every 5 minutes? Use some kind of system task manager like Cron? Then this means that under Windows in debug mode it will be problematic to check the work, a virtual machine will be required. Or is it still somehow possible to get by with something exclusively in Python, or is there no need to create tasks at all, and I'm thinking wrong? Tell me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Damir Abdullin, 2012-01-28
@damirazo

If you only want to display the latest messages from a specific twitter account, then this can be done purely on the client side. Receive js script json with messages (Twitter provides a documented API) and output as required. To avoid constant requests to the API every time the page is refreshed, you can cache messages in localStorage for a while and update as needed.

L
lorien, 2012-01-28
@lorien

Yes, the cron script puts data from the tweeter into the database. Then you display them on the site. The essence of the problem is not clear, under Windows, to check the operation of the script, just run it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question