📜 ⬆️ ⬇️

TwitterLinks - follow popular Twitter links

The idea to peek at what links are popular with Russian-speaking Twitter users came to me a couple of months ago. Then I saw tweetmeme.com and understood exactly how to implement it. It’s really hard to come up with something better for this than a digg-like site that links and votes for them come from Twitter users microblogs.

So, meet - TwitterLinks.Ru .

Considering that the Russian-speaking Twitter audience is still much less English-speaking, I had doubts whether the resource will turn out as interesting as tweetmeme. But, it seems to me, doubts were in vain. The Russian-speaking audience takes quality, not quantity, it turned out a lot of interesting links.
')

As a basis for the site, I took the open code reddit.com and slightly modified it. More precisely, I finalized it for another site, but here many improvements were useful, it remains only to disable unnecessary functionality. The code is written in Python using the Pylons framework.

Then a bot was written that periodically jerks the Twitter search feed and parses it, excluding the tweets of some users who simply broadcast all the links from their resources and do not use twitterfeed (those who use twitterfeed have been cut off by a search query to Twitter). All shortened links are reduced to their canonical form, after which it is checked whether there is such a link in the database. If there is, then its mention is counted as a vote for the link, if not, the link is added to the database. Each user, of course, can vote for a specific link only once.

Every few minutes the script from the reddit.com code tries for each new link to find a suitable picture, for this the page to which the link leads and the largest image in the area is selected, excluding too long and too wide.

Along with links in Russian and Ukrainian, sometimes there are links in Bulgarian and Macedonian, which I do not yet know how to automatically filter, so I delete them manually.

Links can be commented by registering on the site. In the near future I plan to make so that tweets mentioning the link are automatically added as comments, in the event that it is not just a retweet.

Criticism, suggestions and suggestions are welcome.

Source: https://habr.com/ru/post/57357/


All Articles