A web scraper of the monthly statistics of content producers on on-line platforms tracked by socialblade.com
Looking at the issues it appears that this package is controversal for not using an API- this is the author's mistake and will be hopefully addressed in the near future. But right now- users should be warned to use this package at their own risk.
The present version of this package requires the rvest
and xml2
packages for web-scraping,lubriadate
package for handling the dates and the magrittr
package for the pipe-opertator used in the functions developed.
The functions developed for scraping statistics off socialblade.com works for users/channels on to the all platforms which Socialblade tracks. Namely:
The functions are:
```R
sbscrape_youtube()
sbscrape_twitch()
sbscrape_facebook()
sbscrape_instagram()
sbscrape_twitter()
sbscrape_dailymotion()
sbscrape_mixer()
```
Note: All these functions are used to scrape the monthly statistics generated for tracked users on social blade EXCEPT for Facebook and Instagram, which do not have monthly statistics (to my knowlege) generated, rather bi-weekly statistics (as seen on the main page of the users Social Blade dashboard
~~Because this package is still in development this package can only be accessed with the devtools
package.~~
UPDATE JUNE 4,2019: the sbcrapeR package is up on CRAN! To install this package just input the following code in the R console:
install.packages("sbscrapeR")
However if you want to stay up to date with any changes which may occur with this package you can always install the development version from GitHub.
(Assuming you have the devtools
package installed)
devtools::install_github("benyamindsmith/sbscrapeR")
Lets say I want to get the monthly socialblade stats of PewDiePie's YouTube channel.
Because scraping/cleaning this would take a while, why not just save the time and use the sbscrape_youtube()
function.
i.e
(Output as of May 31, 2019 at 6:34 (-4 GMT)
> sbscrape_youtube("https://socialblade.com/youtube/user/pewdiepie/monthly")
Date Culmulative.Subs Culmulative.Views Estimated.Earnings
1 2019-05-02 95291185 21330241041 $3.2K - $50.4K
2 2019-05-03 95338931 21340019243 $3.1K - $49.7K
3 2019-05-04 95381207 21350960339 $3.5K - $55.6K
4 2019-05-05 95418074 21360953504 $3.2K - $50.8K
5 2019-05-06 95446796 21370720994 $3.1K - $49.6K
6 2019-05-07 95476590 21380972608 $3.3K - $52.1K
7 2019-05-08 95509715 21390756182 $3.1K - $49.7K
8 2019-05-09 95537592 21399509337 $2.8K - $44.5K
9 2019-05-10 95568267 21407927459 $2.7K - $42.8K
10 2019-05-11 95600717 21417059553 $2.9K - $46.4K
11 2019-05-12 95646431 21430152995 $4.2K - $66.5K
12 2019-05-13 95705808 21442858484 $4K - $64.5K
13 2019-05-14 95748097 21453413378 $3.4K - $53.6K
14 2019-05-15 95784099 21464218075 $3.4K - $54.9K
15 2019-05-16 95809971 21474674159 $3.3K - $53.1K
16 2019-05-17 95841594 21486219981 $3.7K - $58.7K
17 2019-05-18 95888098 21500643435 $4.6K - $73.3K
18 2019-05-19 95937519 21515600792 $4.7K - $76K
19 2019-05-20 95965363 21525769515 $3.2K - $51.7K
20 2019-05-21 95990492 21535298312 $3K - $48.4K
21 2019-05-22 96018455 21545907665 $3.4K - $53.9K
22 2019-05-23 96047118 21553261633 $2.3K - $37.4K
23 2019-05-24 96075463 21563668727 $3.3K - $52.9K
24 2019-05-25 96101995 21568281297 $1.5K - $23.4K
25 2019-05-26 96122635 21585621484 $5.5K - $88.1K
26 2019-05-27 96146556 21596709721 $3.5K - $56.3K
27 2019-05-28 96172768 21607185737 $3.3K - $53.2K
28 2019-05-29 96208885 21616068161 $2.8K - $45.1K
29 2019-05-30 96250590 21625998317 $3.2K - $50.4K
30 2019-05-31 96281421 21634057245 $2.6K - $40.9K
With this function, I get the Date, Cumulative Subs, Culmulative Views and Potential Earnings of PewDiePie as reported by socialblade!
Lets say I want to know about the monthly preformance of Donald Trump's Twitter Account. Instead of having to "manually" scrape and clean the data fields from Social Blade, just use sbscrape_twitter()
i.e
> sbscrape_twitter("https://socialblade.com/twitter/user/realdonaldtrump/monthly")
Date Followers Following Tweets
1 2019-05-02 59947213 46 41489
2 2019-05-03 59954926 46 41568
3 2019-05-04 59967051 46 41580
4 2019-05-05 59977024 46 41599
5 2019-05-06 59989062 46 41627
6 2019-05-07 60022955 46 41652
7 2019-05-08 60062097 46 41661
8 2019-05-09 60085853 46 41675
9 2019-05-10 60114586 46 41705
10 2019-05-11 60134522 46 41718
11 2019-05-12 60166985 46 41741
12 2019-05-13 60186436 46 41831
13 2019-05-14 60232763 46 41876
14 2019-05-15 60243756 46 41881
15 2019-05-16 60268968 46 41889
16 2019-05-17 60291909 46 41897
17 2019-05-18 60315819 46 41912
18 2019-05-19 60348913 46 41934
19 2019-05-20 60379306 46 41947
20 2019-05-21 60417672 46 41964
21 2019-05-22 60438761 46 41980
22 2019-05-23 60463199 47 42014
23 2019-05-24 60499529 47 42042
24 2019-05-25 60530458 47 42055
25 2019-05-26 60560956 47 42076
26 2019-05-27 60600178 47 42084
27 2019-05-28 60629317 47 42100
28 2019-05-29 60653300 47 42110
29 2019-05-30 60680019 47 42118
30 2019-05-31 60702578 47 42136
With this I get the Date, Donald's culmulative Followers, the culmulative number of people he is following, and the culmulative number of tweets he's made over the past 30 days!
The sbscrapeR
package provides a way to pull data from socialblade.com and to get straight to analyzing it without having to spend time cleaning the data.
Spend more time analyzing data. Not cleaning it.
Enjoy the package!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.