Skip to content

Commit

Permalink
修改data.json的默认排序规则为created
Browse files Browse the repository at this point in the history
  • Loading branch information
hiltay committed Oct 30, 2022
1 parent b0b6436 commit 96cd5ed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
部署教程:[文档](https://fcircle-doc.yyyzyyyz.cn/) | [备用地址](https://fcircle-doc.is-a.dev/)

```
5.0.4 支持:
5.0.5 支持:
- 更好的前端样式
- 极简模式
- 新增前端管理面板,告别繁琐的配置,管理朋友圈更加方便
- 支持 gitee 和 github 上的 issues 友链获取
- 支持butterfly、volantis、matery、sakura、fluid、nexmoe、Yun、stun、stellar、next主题的友链和文章获取
Expand All @@ -25,8 +26,7 @@
- 提供一个简单的快速部署脚本
最近改动:
- 前端管理面板docker缺失的环境变量修复
- 对应前端管理面板更新版本检测功能,规范前端版本
- 增加极简模式
- 极简模式默认排序规则改为created
- stellar主题爬虫抓取规则优化
```

2 changes: 1 addition & 1 deletion api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def all(start: int = 0, end: int = -1, rule: str = "updated"):
"""返回数据库统计信息和文章信息列表
- start: 文章信息列表从 按rule排序后的顺序 的开始位置
- end: 文章信息列表从 按rule排序后的顺序 的结束位置
- rule: 文章排序规则(创建时间/更新时间
- rule: 文章排序规则(创建时间created/更新时间updated
"""
list_ = ['title', 'created', 'updated', 'link', 'author', 'avatar']
return query_all(list_, start, end, rule)
Expand Down
2 changes: 1 addition & 1 deletion hexo_circle_of_friends/scrapy_conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################## 除非您了解本项目,否则请勿修改本文件 ################################
VERSION = "5.0.4"
VERSION = "5.0.5"

# debug
# debug模式
Expand Down
6 changes: 3 additions & 3 deletions hexo_circle_of_friends/spiders/hexo_circle_of_friends.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ def theme_stellar_parse(self, response):
# print("theme_stellar_parse---------->" + response.url)
rule = "stellar"
friend = response.meta.get("friend")
titles = response.css(".post-list .post-title::text").extract()
partial_l = response.css(".post-list .post-card::attr(href)").extract()
createds = response.css("#post-meta time::attr(datetime)").extract()
titles = response.css(".post-list .post-card:not(.photo) .post-title::text").extract()
partial_l = response.css(".post-list .post-card:not(.photo)::attr(href)").extract()
createds = response.css(".post-list .post-card:not(.photo) #post-meta time::attr(datetime)").extract()
updateds = []
try:
for post_info in self.process_theme_postinfo(friend, partial_l, titles, createds, updateds, rule):
Expand Down
2 changes: 1 addition & 1 deletion hexo_circle_of_friends/utils/simple_mode_transform_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def transform():
"""
base_path = get_base_path()
list_ = ['title', 'created', 'updated', 'link', 'author', 'avatar']
data = sqlapi.query_all(list_)
data = sqlapi.query_all(list_, rule="created")
with open(os.path.join(base_path, 'data.json'), "w") as f:
json.dump(data, f)
print(f"读取并转换完毕")
Expand Down

0 comments on commit 96cd5ed

Please sign in to comment.