Skip to content

Commit

Permalink
fix(route): instagram rework (DIYgod#11946)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Feb 23, 2023
1 parent 1cb28ff commit 09739e3
Show file tree
Hide file tree
Showing 14 changed files with 244 additions and 194 deletions.
15 changes: 0 additions & 15 deletions assets/radar-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,21 +592,6 @@
],
},
'eventernote.com': { _name: 'Eventernote', www: [{ title: '声优活动及演唱会', docs: 'https://docs.rsshub.app/anime.html#eventernote', source: '/actors/:name/:id/events', target: '/eventernote/actors/:name/:id' }] },
'instagram.com': {
_name: 'Instagram',
www: [
{
title: '用户',
docs: 'https://docs.rsshub.app/social-media.html#instagram',
source: '/:id',
target: (params) => {
if (params.id !== 'explore' && params.id !== 'developer') {
return '/instagram/user/:id';
}
},
},
],
},
'huya.com': { _name: '虎牙直播', '.': [{ title: '直播间开播', docs: 'https://docs.rsshub.app/live.html#hu-ya-zhi-bo-zhi-bo-jian-kai-bo', source: '/:id', target: '/huya/live/:id' }] },
'craigslist.org': { _name: 'Craigslist', '.': [{ title: '商品搜索列表', docs: 'https://docs.rsshub.app/shopping.html#craigslist' }] },
'scboy.com': {
Expand Down
14 changes: 12 additions & 2 deletions docs/en/social-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,19 @@ If you don't want to setup credentials, use Picuki.

:::

### User Profile
### User Profile / Hashtag

<RouteEn author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['Feed category, see table below','Username / Hashtag name']" radar="1" anticrawler="1">

| User timeline | Hashtag |
| ---------- | ---- |
| user | tags |

<RouteEn author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['Feed category. Only user category is supported for now.','Key for such category. E.g. username/ID for user feed']" radar="1" anticrawler="1"/>
::: tip Tips
It's highly recommended to deploy with Redis cache enabled.
:::

</RouteEn>

## Lofter

Expand Down
14 changes: 12 additions & 2 deletions docs/social-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,19 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性

:::

### 用户
### 用户 / 标签

<Route author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['类别,见下表', '用户名/标签名']" radar="1" anticrawler="1" radar="1">

| 用户时间线 | 标签 |
| ----- | ---- |
| user | tags |

<Route author="oppilate DIYgod" example="/instagram/user/stefaniejoosten" path="/instagram/:category/:key" :paramsDesc="['时间线类别,目前仅支持用户时间线','针对该类别的索引,例如用户时间线里是用户名或用户 ID']" radar="1" anticrawler="1"/>
::: tip Tips
建议在部署时使用 Redis 缓存。
:::

</Route>

## Keep

Expand Down
15 changes: 0 additions & 15 deletions lib/radar-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,21 +1283,6 @@ module.exports = {
},
],
},
'instagram.com': {
_name: 'Instagram',
www: [
{
title: '用户',
docs: 'https://docs.rsshub.app/social-media.html#instagram',
source: '/:id',
target: (params) => {
if (params.id !== 'explore' && params.id !== 'developer') {
return '/instagram/user/:id';
}
},
},
],
},
'huya.com': {
_name: '虎牙直播',
'.': [
Expand Down
2 changes: 1 addition & 1 deletion lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -3362,7 +3362,7 @@ router.get('/mitbbs/:caty?', lazyloadRouteHandler('./routes/mitbbs/index'));
router.get('/jiazhen108', lazyloadRouteHandler('./routes/jiazhen108/index'));

// Instagram
router.get('/instagram/:category/:key', lazyloadRouteHandler('./routes/instagram/index'));
// router.get('/instagram/:category/:key', lazyloadRouteHandler('./routes/instagram/index'));

// 优设网
router.get('/uisdc/talk/:sort?', lazyloadRouteHandler('./routes/uisdc/talk'));
Expand Down
131 changes: 0 additions & 131 deletions lib/routes/instagram/index.js

This file was deleted.

28 changes: 0 additions & 28 deletions lib/routes/instagram/utils.js

This file was deleted.

3 changes: 3 additions & 0 deletions lib/v2/instagram/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/:category/:key': ['oppilate', 'DIYgod'],
};
Loading

0 comments on commit 09739e3

Please sign in to comment.