在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ThomasChln/mastodon开源软件地址(OpenSource Url):https://github.com/ThomasChln/mastodon开源编程语言(OpenSource Language):R 92.7%开源软件介绍(OpenSource Introduction):MastodonInstallation in RUse the devtools R package to install from Github: devtools::install_github('ThomasChln/mastodon') DockerA docker image with the package installed is also available docker run -it thomaschln/mastodon UsageLogin and postslibrary(mastodon)
token = login('https://framapiaf.org/', '[email protected]', 'password')
post_status(token, 'Status text')
post_media(token, 'Image caption', file = '/home/user/file.png')
post_ggplot(token, 'Mastodon instances and users', ggplot_instances_info()) Timelines and hashtagsdf = get_timeline(token, 'home')
df = get_timeline(token, 'local')
df = get_timeline(token, 'fediverse')
df = get_hashtag(token, 'rstats')
# Get more toots (default rate limit: 2 second sleep for each 20 toots)
df = get_timeline(token, 'fediverse', n = 30)
df = get_hashtag(token, 'mastodon', n = 30)
# Get toots before a specific id
df = get_timeline(token, 'fediverse', max_id = 26432)
df = get_hashtag(token, 'mastodon', max_id = 26432)
# Get hashtag only on local instance
df = get_hashtag(token, 'rstats', local = TRUE) SearchesSearch for a string or a username df = search(token, 'thchln')
# don't resolve non-local accounts
df = search(token, 'thchln', local = TRUE)
df = search_username(token, 'thchln')
df = search_username(token, 'thchln', limit = 2) Get an account or a toot by id account = get_account(token, 475)
toot = get_status(token, 26432) Fediverse info and plotsNumber of users per instances ggplot_instances_info() Participation by hours # Use a large server
token = login('https://mastodon.xyz/', '[email protected]', 'password')
df_toots = get_timeline(token, 'fed', n = 7e4)
toots_by_hours(df_toots) %>% ggplot_toots_by_hours(token$instance) Participation of top 6 instances toots_by_instances(df_toots) %>% ggplot_toots_by_instances(token$instance) Acknowledgements
LicenseThis package is free and open source software, licensed under GPL-3. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论