Back to Home

Measuring Telegram

telegram · analytics · api · crawling · scraping · python · javascript · google chrome extensions

Measuring Telegram

“So far, the opportunities for full-fledged channel analytics are
limited, first of all, by the capabilities of BotAPI Telegram”

Telegram Marketing Channel, June 28, 2016

Everything is fine with Telegram channels, except for one - they are too difficult to look for. Links can be found almost everywhere ...

For instance:
On the Internet:

1. With the help of robots indexing one channel in search of other channels ( 1.1 , 1.2 )
2. In channel directories replenished by channel owners ( 2.1 , 2.2 )
3. On channel exchanges ( 3.1 , 3.2 )
4. In subject collections channels (also flashed here: 4.1 , 4.2 )
5. In the lists of channels ( 5.1 )
6. In Google Dock with channels about channels (taken from @raskruti: 6.1 )

In a mobile application:

7. By downloading the application with a channel catalog (for iOS: TeleBots)

In Telegram itself:

8. On channels about channels ( 8.1 )
9. Using bots for channels ( 9.1 )
10. On channels about channels about channels ( 10.1 )

... but the search process remains far from perfect. Without a single source of data and normal analytical tools, it is difficult not only to find, but even to understand:
1. How widespread are the channels in Russia?
2. How popular are the channels and what is “popularity” in numbers?

These questions need to be answered in numbers. Only scattered data can be found on the Internet. Something is on Rusbase ( here ), in Vedomosti ( here ), on Twitter ( here ), but all this information is not systematic and difficult to verify.

This article is devoted to the analysis of the Russian-language Telegram-channels market. Work has been done from collecting a generalized (unreliably complete) list of Russian-language channels to crawling their contents and building metrics. Only those channels that were promoted on the big Internet were analyzed, indicating links to themselves. This behavior is an indicator of channels created for a large audience.


Step 1. Collecting a list of channels


In the beginning, a unified database was created using methods of guerrilla analytics. Two online directories were selected as data sources in which users enter their channels manually: tlgrm.ru and tchannels.me, and two self-completing directories: tsear.ch ( about authors ) and inten.to ( about authors in the section “About us ”at the bottom of the page ), one is re-indexed manually, the other - in real time. All sites searched for channels identified as Russian. Below is a short table for comparing sources.



What allows you to be sure that the channels found are in Russian?

1. tlgrm.ru is by default created for channels in Russian;
2. tchannels.me consists of channels added manually and explicitly specified as Russian (two languages ​​for the channel cannot be specified there by design);
3. tsear.ch determines the language of the channel based on the analysis of its contents using the Yandex.Translate API;
4. inten.to was created by authors specializing in a unified API for translation services, which is used to automatically determine the language of channels.

Tools used in the work: Chrome Developer Tools, cURL to Python converter, Python itself, general erudition.

More than 10,000 channels were found, the results are presented in diagrams. The main conclusion: the databases of various directories coincide only by 3%.

image

How were the data obtained in the above table


Manually updated directories

1. tlgrm.ru Target section: / channels /. To get a complete list, you need to bypass all relevant categories and "write off" channel IDs, they will be right in the body of the page.

2. tchannels.me You can select Russian in the catalog settings and scroll through 27 categories one after another. You can also take advantage of the service API by slightly changing the parameters: tchannels.me/api/channels?list=top&categoryId=&languages=russian&offset=0&count=1000000

Automatically updated directories

3. tsear.ch Target section: / list / ru /. By clicking on the Next button again and again, you can record channels from each page and make a general list.

4. inten.toTarget section: / telegram / channels / russian /. The creators of the catalog are very worried about the safety of their database: a channel can be found either by a complete match of the request with the channel ID, or by a partial match with the text of its description, while the search returns no more than 100 first matches, but not immediately the entire hundred, but 10 pieces. Have been tried: the “forehead” method and search by exhaustive search for combinations of three letters. Thus, a total of 1722 channels were found. This is definitely not all, since the rating manually compiled according to these data did not coincide with the original rating inten.to.
In order to evaluate the completeness of the database in the case of inten.to, the method “from the contrary” was applied. First, a list of unique channels was collected from the previous three sources (a total of 8283 channels), then a search was launched for each of them in the inten.to database. As a result, 3325 of 8283 (~ 40%) channels were found, which allows us to estimate the size of the base of Russian-language channels in inten.to as 3325 + 1783 ~ = 5100.

Step 2. Development of a statistics collection tool


No one in their right mind would walk around all 10,000 channels with their hands — no time. In addition, directories are constantly updated - here you need a tool for regular use. The author had some experience in “pumping” a web browser, so the decision was made to go along the path of automating the Telegram web client using an extension to the browser.

Arguments in defense of this method:

1. Sufficiency for solving the problem: the extension allows you to make javascript injections and gives convenient access to the page code using JQuery
2. Visibility: a script that clicks and drives text in real time, it’s clear how to twist
3. Scalability in principle: by installing a crawler-agent on five virtual machines and deploying somewhere a server that distributes “tasks” for crawling agents, you can get a botnet (in extensions you can send requests outside, distribution can be done via webhook)
4. Simple and quick installation: the crawler is installed on any computer with a browser and does not require pre-configuration to work. The code can be modified for further work
5. Cross-platform: Google Chrome is available for all common operating systems
6. Easy and free access to VPN: due to the prevalence of the corresponding browser extensions (Hola, frigate, etc.)

This approach essentially turns crawling into a perverse (without Selenium'a) spelling of GUI autotests. You can watch the crawling process on the video:



Looking ahead, we say that the approach was not universal, as the Telegram web client is running out of memory. When I tried to download the entire channel history with a flood (scrolled up), all posts were cached, and the browser started to slow down terribly. Instead of fixing the web client (the code before the webpack ), raising your instance and crawling through it, it was decided to simply exclude the channels with the flood from consideration.

Step 3. Scaling the process


To get to Telegram you need to go through SMS authorization. Nowadays, this, it would seem, no longer requires a person: you could buy numbers on twilio and use the SMS API, but this did not work. Therefore, a direct solution was used: 15 SIM cards were bought on hand at the Belorussky Train Station. It remained to charge all the old and unnecessary phones that were available, pick up a couple of virtual machines on a home wheelbarrow and begin collecting data.

Step 4. Collecting statistics from within Telegram, discussing the results


We will consider the main patterns on a selection of channels from the site tlgrm.ru. Arguments in favor of this source:

1. Only 13% of unique channels, that is, most of them are still found somewhere - the owners of the channels are concerned about promotion;
2. The presence of categories in the catalog - there will be more interesting and accurate analytics;
3. Russian domain + popularity in RuNet = channels will be Russian in 99% of cases, you can not double-check.

For the study, almost all categories of channels were selected, except for channels with 18+ content and channels in Uzbek - the first for nothing and one flood, and the second on average more advanced, so their presence would "push" the statistics up.

Further, having broken down the list of all channels into quanta of ~ 500 pieces (after 500 Telegram is banned for calling the search method too often) and running crawlers in different virtual machines (the author strives to use high performance computing at every opportunity), we get statistics for the period from the last post on the channel in depth for at least a week. If the channel has not had posts for seven days, we consider the channel “dead”. If posts go more than once every three hours - this is a floodhouse. The following are the results slides and discussion in the FAQ format.

image

What is the size of our sample?
Three independent measurements were taken: May 3, June 4, and June 23. There were 1,889 channels in the categories of interest to us, all three times present on tlgrm.ru.

Are new channels being created?
Yes, constantly. Judging by the dates of the creation of the channels, at least 3-4 channels appear every day.

Do these channels read and how actively?
Yes, they read, quite actively. Over 70% of the channels “grew” in the last 2 months, the total increase in subscriptions was almost 900 thousand (suspiciously fast-growing channels were filtered out from this figure, more about them later), while only 60 thousand were “unsubscribed” from the channels that they once visited .

How many channels are “normal”?
65% of channels are regularly updated and it does not seem that they are very flooding. On the other hand, every third randomly taken channel either has not been updated for a long time, or with a flood.

image

What is Telegram “success”?
As the graph above shows, success is when the channel grows at a speed of 160 people per day or more. Even the best channels could not show an average speed higher than this value. We advise you to pay attention to music channels: there are relatively few of them, but they have many subscribers. You can try to think in this direction. At the same time, channels with gifs and funny vidos are especially popular: according to statistics, in two months they have grown at least four times more than any other channel.

Summary


The numbers are shown in the graphs, qualitative conclusions are listed below in a list.

At the stage of collecting the list of channels

1. There are more than ten thousand channels in Russian - this is a lot, you can’t re-read it in your life
2. Each of the directories maintains its own small list and does not exchange it with its “neighbors”, which means for the user to search many in places - this is very inconvenient

According to the stage of channel analysis

1. Channels as a phenomenon continue to develop - there are more and more of them every day;
2. The number of subscriptions to channels is growing at a monstrous pace, almost half a million every month;
3. The introduction of more complex metrics allows you to generate automatic channel selections, which nevertheless need a human review.

Already, Russian users are looking for channels, spending dozens of clicks on finding content to their liking. At the same time, per month the growth of subscriptions on these channels in total is half a million per month. If a service appears that allows you to search for channels centrally and switch between them with just one click, the popularity of Telegram will increase significantly.

Given the above, it's time to use the resources of the developers. In order to increase usability by the service, we recommend that catalog owners do the following:

1. Update their channel classifiers - web.archive tells you that they have not changed in almost anyone since the moment they were created. It's summer, you can hire students.
2. Change the interface of sites by making a “list” of channels in the spirit of Yandex.Music so that a maximum of one click is required to select a new channel.
3. Start monitoring how people search for channels and measure how much they watch per session; developers give bonuses for exceeding indicators.
4. Contact the creators of inten.to and offer them integration - for them, Telegram is not a core business, and their technology can be used to create the best catalog on the market.

Materials used in the article
All the results (presentation, tables, code) are posted in open access.

1. Presentation, spreadsheets, channel lists - archive on Google.Drive
2. Extension code - repository on Github
3. Contact details in Telegram:devrazdev

Thank you.

PS Finally, a short funny story about us and Telegraph in the form of step-by-step instructions:

1. Go to telegra.ph
2. Master the mechanics: drive into all the test fields, click publish. I at one time happened so . This means that my post was the sixteenth post with the title test for that day (June 14th).
3. You have insight
4. You start to travel in time and spy on others like you, who also wrote test in the title, just changing the numbers. You can, for example, travel back to January 20 and accidentally meet a soul mate .

Read Next