feat: add mastodon user timeline (#5188)

This commit is contained in:
notofoe
2020-07-29 14:27:23 +01:00
committed by GitHub
parent 580fea513f
commit e7d62ebcd9
10 changed files with 224 additions and 38 deletions
+5
View File
@@ -427,6 +427,11 @@ See the relation between access key/code and white/blacklisting.
- `DISCUZ_COOKIE_{cid}`: Cookie of a forum powered by discuz, cid can be anything from 00 to 99. When visiting route discuz, using cid to specify this cookie.
- Mastodon user timeline: apply api here `https://mastodon.example/settings/applications`, please check scope `read:search`
- `MASTODON_API_HOST`: api instance domain
- `MASTODON_API_ACCESS_TOKEN`: user access token
- `MASTODON_API_ACCT_DOMAIN`: acct domain for particular instance
- Sci-hub for scientific journal routes:
- `SCIHUB_HOST`: The Sci-hub mirror address that is accssible from your location, default to `https://sci-hub.tw`.
+14 -3
View File
@@ -30,15 +30,26 @@ pageClass: routes
::: tip
Offical user RSS: https://**:instance**/users/**:username**.atom or https://**:instance**/users/**:username**.rss
Official user RSS:
- RSS: `https://**:instance**/users/**:username**.rss` ([Example](https://pawoo.net/users/pawoo_support.rss))
- Atom: ~~`https://**:instance**/users/**:username**.atom`~~ (Only for pawoo.net, [example](https://pawoo.net/users/pawoo_support.atom))
For example, https://pawoo.net/users/pawoo_support.atom or https://pawoo.net/users/pawoo_support.rss
These feed do not include boosts (a.k.a. reblogs). RSSHub provides a feed for user timeline based on the Mastodon API, but to use that, you will need to create application on a Mastodon instance, and configure your RSSHub instance. Check the [Deploy Guide](/en/install/#route-specific-configurations) for route-specific configurations.
:::
### User timeline
<RouteEn author="notofoe" example="/mastodon/acct/CatWhitney@mastodon.social" path="/mastodon/acct/:acct/:only_media?" :paramsDesc="['Webfinger account URI', 'whether only display media content, default to false, any value to true']"/>
### Timeline
<RouteEn author="hoilc" example="/mastodon/timeline/pawoo.net/true" path="/mastodon/timeline/:site/:only_media?" :paramsDesc="['instance address, noly domain, no `http://` or `https://` protocol header', 'whether only display media content, default to false, any value to true']"/>
<RouteEn author="hoilc" example="/mastodon/timeline/pawoo.net/true" path="/mastodon/timeline/:site/:only_media?" :paramsDesc="['instance address, only domain, no `http://` or `https://` protocol header', 'whether only display media content, default to false, any value to true']"/>
### User timeline (backup)
<RouteEn author="notofoe" example="/mastodon/account_id/mastodon.social/23634/statuses/only_media" path="/mastodon/account/:site/:account_id/statuses/:only_media?" :paramsDesc="['instance address, only domain, no `http://` or `https://` protocol header', 'account id. login your instance, then search for the user profile; the account id is in the url', 'whether only display media content, default to false, any value to true']"/>
## piapro
+5
View File
@@ -463,6 +463,11 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
- `WEIBO_APP_SECRET`: 微博 App Secret
- `WEIBO_REDIRECT_URL`: 微博登录授权回调地址,默认为 `RSSHub 地址/weibo/timeline/0`,自定义回调地址请确保最后可以转跳到 `RSSHub 地址/weibo/timeline/0?code=xxx`
- Mastodon 用户时间线路由:访问 `https://mastodon.example/settings/applications` 申请(替换掉 `mastodon.example`)。需要 `read:search` 权限
- `MASTODON_API_HOST`: API 请求的实例
- `MASTODON_API_ACCESS_TOKEN`: 用户 access token, 申请应用后,在应用配置页可以看到申请者的 access token
- `MASTODON_API_ACCT_DOMAIN`: 该实例本地用户 acct 标识的域名
- 饭否 全部路由:[申请地址](https://github.com/FanfouAPI/FanFouAPIDoc/wiki/Oauth)
- `FANFOU_CONSUMER_KEY`: 饭否 Consumer Key
+15 -2
View File
@@ -322,16 +322,29 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
::: tip 提示
官方提供了用户时间线 RSS: `https://**:instance**/users/**:username**.atom` 或 `https://**:instance**/users/**:username**.rss`
通常来说,各实例提供用户时间线的订阅源,如下:
例如:<https://pawoo.net/users/pawoo_support.atom> 或 <https://pawoo.net/users/pawoo_support.rss>
- RSS: `https://**:instance**/users/**:username**.rss`
- Atom: ~~`https://**:instance**/users/**:username**.atom`~~ (仅 pawoo.net)
例如:<https://pawoo.net/users/pawoo_support.rss> 或 <https://pawoo.net/users/pawoo_support.atom>
上述订阅源的内容不包括用户的转嘟。RSSHub 提供基于 Mastodon API 的订阅源,但需要您在某个 Mastodon 实例申请 API,并对 RSSHub 实例进行配置。详情见部署页面的配置模块。
:::
### 用户公共时间线
<Route author="notofoe" example="/mastodon/acct/CatWhitney@mastodon.social/statuses" path="/mastodon/acct/:acct/statuses/:only_media?" :paramsDesc="['Webfinger account URI, 形如 `user@host`', '是否只显示包含媒体(图片或视频)的推文, 默认置空为否, 任意值为是']"/>
### 实例公共时间线
<Route author="hoilc" example="/mastodon/timeline/pawoo.net/true" path="/mastodon/timeline/:site/:only_media?" :paramsDesc="['实例地址, 仅域名, 不包括`http://`或`https://`协议头', '是否只显示包含媒体(图片或视频)的推文, 默认置空为否, 任意值为是']"/>
### 用户公共时间线(备用)
<Route author="notofoe" example="/mastodon/account_id/mastodon.social/23634/statuses/only_media" path="/mastodon/account/:site/:account_id/statuses/:only_media?" :paramsDesc="['实例地址, 仅域名, 不包括`http://`或`https://`协议头', '用户 ID. 登录实例后, 搜索用户并进入用户页, 在地址中可以找到这串数字', '是否只显示包含媒体(图片或视频)的推文, 默认置空为否, 任意值为是']"/>
## piapro
### 用户最新作品