Answer the question
In order to leave comments, you need to log in
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
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question