Skip to content

Commit

Permalink
照搬大发哥影音页面完成初版
Browse files Browse the repository at this point in the history
  • Loading branch information
rebron1900 committed Apr 22, 2024
1 parent 03dced3 commit bd825f5
Show file tree
Hide file tree
Showing 13 changed files with 1,052 additions and 24 deletions.
19 changes: 19 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const articleUrl = require("./eleventy/filters/articleUrl.js");
const articleCategoryUrl = require("./eleventy/filters/articleCategoryUrl.js");
// const highlight = require("./eleventy/filters/highlight.js");
const groupbydate = require("./eleventy/filters/groupbydate.js");
const doubanGroupbydate = require("./eleventy/filters/doubanGroupbydate.js");
const usMonth = require("./eleventy/filters/usMonth.js");

// // Import shortcodes
Expand Down Expand Up @@ -73,6 +74,7 @@ module.exports = function (config) {
// return Math.ceil(numberOfWords / wordsPerMinute);
// });
config.addFilter("groupbydate", groupbydate);
config.addFilter("doubanGroupbydate", doubanGroupbydate);
config.addFilter("usMonth", usMonth);

// // Shortcodes
Expand Down Expand Up @@ -336,6 +338,23 @@ module.exports = function (config) {
return collection;
});


// Get All Douban
config.addCollection("douban", async function (collection) {
if (fluxToken) {
try {
const response = await fetch(
"https://fastraw.ixnic.net/rebron1900/doumark-action/master/data/neodb/movie.json"
);
let data = await response.json();
return data;
} catch (error) {
console.log("请求错误:", error);
}
}
return collection;
});

return {
dir: {
input: "src/site",
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
},
cdnUrl: "https://cdn.1900.live",
},
customPage: ["archives", "memos", "links"],
customPage: ["archives", "memos", "links","douban"],
ghost: {
url: "https://cms.1900.live",
key: "54bae25f075f027aba23d6f657",
Expand Down
110 changes: 110 additions & 0 deletions eleventy/filters/doubanGroupbydate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/* ***** ----------------------------------------------- ***** **
/* ***** RSS Date Filter
/* ***** ----------------------------------------------- ***** */

const _ = require("lodash");

module.exports = (data) => {
// 先按照年份分组
let result = _(data)
.groupBy(x => x.created_time.substring(0, 4)) // group by year
.map((value, key) => ({
year: key,
data: _(value).groupBy(x => x.created_time.substring(5, 7)) // group by month
.map((v, k) => ({ month: k, data: v })).orderBy(['month'], ['desc']).value() // formate month data
}))
.orderBy(['year'], ['desc'])
.value();

return result;
};





// {
// "data": [
// {
// "shelf_type": "complete",
// "visibility": 0,
// "item": {
// "id": "https://neodb.social/movie/0P9RvOsBrrnJlXQeiT6w17",
// "type": "Movie",
// "uuid": "0P9RvOsBrrnJlXQeiT6w17",
// "url": "/movie/0P9RvOsBrrnJlXQeiT6w17",
// "api_url": "/api/movie/0P9RvOsBrrnJlXQeiT6w17",
// "category": "movie",
// "parent_uuid": null,
// "display_title": "陌路狂刀",
// "external_resources": [
// { "url": "https://movie.douban.com/subject/36402339/" }
// ],
// "title": "陌路狂刀",
// "brief": "天下大乱,齐王篡权,暗中诛杀太子遗嗣,卖炭翁田安邺无意中卷入此局,一番亦敌亦友的殊死争斗中,田安邺身上的秘密,以及当年梁城百姓殉城的真相也被揭开……",
// "cover_image_url": "https://neodb.social/m/item/doubanmovie/2024/03/11/e54b25e0-83af-4eed-baa6-d48c02bb64d8.webp",
// "rating": null,
// "rating_count": 1
// },
// "created_time": "2024-03-10T10:03:46Z",
// "comment_text": "烂片",
// "rating_grade": 4,
// "tags": []
// },
// {
// "shelf_type": "complete",
// "visibility": 0,
// "item": {
// "id": "https://neodb.social/movie/6KMHyWIms9uoku0kRw83aA",
// "type": "Movie",
// "uuid": "6KMHyWIms9uoku0kRw83aA",
// "url": "/movie/6KMHyWIms9uoku0kRw83aA",
// "api_url": "/api/movie/6KMHyWIms9uoku0kRw83aA",
// "category": "movie",
// "parent_uuid": null,
// "display_title": "新秩序",
// "external_resources": [
// { "url": "https://movie.douban.com/subject/35572588/" }
// ],
// "title": "新秩序",
// "brief": "横跨黑白两道只手遮天的洪泰集团正值换选之际,一个神秘杀手陈安(张家辉 饰)却突然只身闯入这个是非混乱的旋涡,搅得洪泰集团大乱。身处警察阵营的麦朗汶(阮经天 饰)和黑帮阵营的马文康(王大陆 饰)也盯上了他……\n各方势力伺机而动,谁才是幕后的操控者?一场生猛混战一触即发。",
// "cover_image_url": "https://neodb.social/m/movie/2022/05/1572232d9a-0e4c-4855-b86e-7fa5bf6c49d3.jpg",
// "rating": 6.4,
// "rating_count": 8
// },
// "created_time": "2024-03-10T10:03:27Z",
// "comment_text": "男版消失的他",
// "rating_grade": 8,
// "tags": []
// },
// {
// "shelf_type": "complete",
// "visibility": 0,
// "item": {
// "id": "https://neodb.social/tv/season/3q7cVrDwt0G7FgqNBI5J3B",
// "type": "TVSeason",
// "uuid": "3q7cVrDwt0G7FgqNBI5J3B",
// "url": "/tv/season/3q7cVrDwt0G7FgqNBI5J3B",
// "api_url": "/api/tv/season/3q7cVrDwt0G7FgqNBI5J3B",
// "category": "tv",
// "parent_uuid": "3gueKynn2jufwZqzm22RWE",
// "display_title": "杀人者的购物中心",
// "external_resources": [
// { "url": "https://www.themoviedb.org/tv/215072/season/1" },
// { "url": "https://movie.douban.com/subject/36174946/" }
// ],
// "title": "杀人者的购物中心",
// "brief": "在郑镇万(李栋旭 饰)突然过世后,他的侄女郑智安(金慧埈 饰)发现叔叔留下的可疑购物中心。她的叔叔是什么人?他在经营何种购物中心?在智安还不明白发生何事时,觊觎购物中心仓库的可疑顾客们便展开袭击。\n改剧改编自作家姜智英创作同名小说。",
// "cover_image_url": "https://neodb.social/m/item/doubanmovie/2024/01/07/ed4c14c8-a0da-4897-b379-548c09542210.webp",
// "rating": 6.6,
// "rating_count": 29
// },
// "created_time": "2024-02-25T15:28:46Z",
// "comment_text": null,
// "rating_grade": null,
// "tags": []
// }
// ],
// "pages": 28,
// "count": 553
// }
19 changes: 0 additions & 19 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@
status = 301
force = true

[[redirects]]
from = "/.well-known/webfinger/*"
to = "https://gts.1900.live/.well-known/webfinger"
status = 301
force = true

[[redirects]]
from = "/.well-known/host-meta/*"
to = "https://gts.1900.live/.well-known/host-meta"
status = 301
force = true

[[redirects]]
from = "/.well-known/nodeinfo/*"
to = "https://gts.1900.live/.well-known/nodeinfo"
status = 301
force = true





Expand Down
Loading

0 comments on commit bd825f5

Please sign in to comment.