• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ThomasChln/mastodon: R based Mastodon client

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ThomasChln/mastodon

开源软件地址(OpenSource Url):

https://github.com/ThomasChln/mastodon

开源编程语言(OpenSource Language):

R 92.7%

开源软件介绍(OpenSource Introduction):

Mastodon

Installation in R

Use the devtools R package to install from Github:

devtools::install_github('ThomasChln/mastodon')

Docker

A docker image with the package installed is also available

docker run -it thomaschln/mastodon

Usage

Login and posts

library(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 hashtags

df = 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)

Searches

Search 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 plots

Number 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

License

This package is free and open source software, licensed under GPL-3.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap