kiosko-plugin-news 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.js +651 -139
- package/kiosko-manifest.json +205 -178
- package/package.json +9 -2
package/dist/index.js
CHANGED
|
@@ -5,6 +5,21 @@ import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as r
|
|
|
5
5
|
import { join as join2 } from "node:path";
|
|
6
6
|
import { definePlugin, defineSource, defineWidget, filterPatterns, matchFilter, t } from "@kiosko/sdk";
|
|
7
7
|
|
|
8
|
+
// src/hanzi.ts
|
|
9
|
+
var TRADITIONAL = "\u6176\u7C72\u6490\u76E4\u52F5\u52F8\u532F\u53AD\u5718\u57F7\u5805\u5831\u584A\u5857\u58C7\u58FD\u5967\u599D\u5BF5\u5EDA\u5F4E\u5F59\u5FB9\u6046\u60E1\u60F1\u611B\u6158\u6163\u616E\u6182\u6191\u61B2\u61F2\u61F8\u6383\u639B\u63A1\u63DA\u640D\u6416\u6436\u64AB\u64E0\u64F2\u650F\u6514\u6583\u65AC\u6649\u66C9\u66EC\u66F8\u68DF\u6A02\u6A1E\u6A5F\u6AAF\u6B04\u6BB2\u6BC6\u6C2B\u6C59\u6C7A\u6C92\u6C96\u6CC1\u6D29\u6E1B\u6E2C\u6E67\u6E96\u6E9D\u6EEF\u6F38\u6F54\u6F70\u6FA4\u6FE4\u6FEB\u7015\u7058\u7210\u721B\u7246\u72A7\u72C0\u7336\u7345\u7375\u7378\u737B\u755D\u758A\u760B\u7652\u76DE\u779E\u790E\u78A9\u79B1\u7A05\u7A2E\u7A4E\u7AC4\u7ACA\u7BC0\u7BC9\u7BE4\u7C3E\u7C60\u7C64\u7CB5\u7CDE\u7D0B\u7D0D\u7D1B\u7DE0\u7DEC\u7DEF\u7E2B\u7E31\u7E5E\u7E6A\u7E6B\u7E8F\u7E9C\u7F70\u8077\u8073\u8108\u814E\u816B\u8173\u81D8\u81E5\u838A\u83EF\u840A\u842C\u8449\u84BC\u84CB\u84EE\u8525\u852D\u85A6\u85A9\u85E5\u8606\u860A\u865C\u87FB\u881F\u8932\u8A5E\u8A87\u8ABC\u8AD2\u8ADC\u8AE7\u8AF7\u8B0A\u8B0E\u8B19\u8B39\u8B4F\u8B74\u8B7D\u8C4E\u8C6C\u8CEC\u8CED\u8CFA\u8D16\u8D1B\u8F1D\u8F44\u8F4E\u8FAD\u8FAF\u8FF4\u904A\u9127\u919E\u91AC\u91C0\u9223\u923E\u9280\u9285\u92B3\u92C1\u92F0\u9336\u934A\u938A\u947D\u9598\u95A5\u95D6\u9695\u97CC\u985B\u98C6\u9935\u9913\u9A19\u9B06\u9EB5\u9EF4\u9019\u500B\u5011\u4F86\u6642\u8AAA\u6703\u5C0D\u65BC\u8207\u70BA\u767C\u958B\u95DC\u570B\u5B78\u61C9\u904E\u9084\u9032\u7D93\u9EDE\u52D5\u5BE6\u73FE\u5F9E\u5F8C\u7576\u9AD4\u5169\u696D\u52D9\u9577\u9580\u554F\u984C\u9593\u982D\u7FA9\u8ECA\u96FB\u8A71\u5C0E\u7063\u81FA\u7DB2\u7DDA\u5340\u806F\u7E3D\u7D71\u9EE8\u9078\u8209\u8B70\u54E1\u7E23\u9109\u5834\u50F9\u9322\u8CA8\u5E63\u8CC7\u7522\u71DF\u984D\u6F32\u8B8A\u6578\u64DA\u8853\u8166\u8EDF\u96AA\u6C23\u6EAB\u98B1\u98A8\u96F2\u6230\u722D\u8ECD\u8266\u98DB\u5F48\u64CA\u885B\u8B77\u91AB\u7642\u8A3A\u6AA2\u78BA\u968A\u8CFD\u8D0F\u8F38\u904B\u8B93\u8A8D\u8B58\u8AD6\u8996\u983B\u5EE3\u8A0A\u6B0A\u6B50\u6771\u9678\u5CF6\u96D9\u55AE\u865F\u78BC\u6AC3\u64F4\u8A2D\u8A08\u5283\u756B\u898F\u7BC4\u689D\u7D04\u8CBB\u9435\u6A4B\u71C8\u6A13\u5EE0\u7926\u8FB2\u6F01\u88FD\u8A9E\u8AB2\u8A66\u7D1A\u985E\u8CB7\u8CE3\u8CFC\u74B0\u614B\u52E2\u89C0\u8A62\u807D\u8B80\u5BEB\u8FA6\u8655\u56B4\u5FA9\u8208\u8607\u96A8\u6A23\u50C5\u5E7E\u5104\u8F1B\u885D\u707D\u96E3\u50B7\u5C6C\u7F77\u7D50\u5354\u6B72\u9F61\u5152\u5B6B\u5A66\u5E2B\u7D00\u9304\u5275\u96BB\u968E\u5C64\u5F35\u9673\u5289\u694A\u9EC3\u8D99\u5433\u8A31\u912D\u8B1D\u7F85\u99AE\u8523\u97D3\u9F94\u7FD2\u8CF4\u99AC\u856D\u97CB\u9867\u9589\u9583\u95B1\u95C6\u967D\u9670\u969B\u96B1\u96DC\u96DE\u96E2\u9748\u975C\u97FF\u9801\u9805\u9806\u9808\u9810\u9818\u9846\u984F\u9858\u986F\u98EF\u98F2\u9928\u9952\u99D5\u9A57\u9A0E\u9A5A\u9AEE\u9B25\u9B5A\u9BAE\u9CE5\u9CF4\u9EA5\u9F4A\u9F52\u9F8D\u9F9C\u7562\u7570\u76E3\u76E7\u773E\u774F\u7919\u79AE\u798D\u7A31\u7A4D\u7A69\u7AAE\u7AF6\u7B46\u7C21\u7C43\u7CE7\u7D05\u7D14\u7D19\u7D30\u7D42\u7D44\u7D55\u7D72\u7DA0\u7DAD\u7D9C\u7DCA\u7DE8\u7DE3\u7E3E\u7E7C\u7E8C\u7F75\u8072\u8085\u8105\u81BD\u81DF\u81E8\u820A\u8259\u85DD\u85CD\u862D\u865B\u87F2\u88DD\u88DC\u8907\u898B\u89AA\u89BA\u89F8\u8A02\u8A0E\u8A13\u8A17\u8A18\u8A2A\u8A34\u8A3C\u8A55\u8A69\u8A72\u8A73\u8A95\u8AA4\u8ABF\u8AC7\u8ACB\u8AFE\u8B00\u8B02\u8B49\u8B5C\u8B6F\u8C50\u8CA0\u8CA1\u8CA2\u8CA7\u8CA9\u8CAA\u8CAC\u8CB8\u8CBC\u8CBF\u8CCA\u8CD3\u8CE0\u8CDE\u8CE2\u8CEA\u8D0A\u8D95\u8DA8\u8E64\u8E8D\u8ECC\u8F03\u8F09\u8F14\u8F15\u8F29\u8F2A\u8F49\u9054\u9077\u9060\u9069\u907A\u908A\u90F5\u9130\u91CB\u91DD\u91E3\u9214\u92FC\u9326\u932F\u9375\u9396\u93AE\u93E1\u9663\u9742\u9802\u9812\u9813\u9817\u9838\u98B6\u98C4\u9A45\u9B27\u9B6F\u9CF3\u9E97\u9F90\u5716\u5712\u570D\u5713\u58D3\u58DE\u58E9\u58EF\u5099\u5920\u5925\u5922\u596A\u734E\u596E\u5ABD\u5B30\u5BE7\u5BE9\u5BEC\u5BF6\u5C07\u5C08\u5C0B\u5C46\u5CA1\u5DBC\u5D17\u5CFD\u5E25\u5E33\u5E36\u5E6B\u5E79\u5EF3\u5EE2\u5EDF\u5F65\u5F37\u6B78\u5F91\u5FB5\u6200\u6232\u6236\u64C1\u64C7\u64CB\u64D4\u64FE\u651C\u651D\u64A5\u64EC\u64FA\u6524\u6557\u6558\u6575\u6582\u65B7\u66AB\u66C6\u6975\u69CB\u69CD\u6A19\u6A6B\u6A94\u6A39\u6B61\u6B77\u6B98\u6BBA\u6BBC\u6BC0\u6F22\u6F5B\u6FDF\u6FF1\u6FC3\u6FD5\u6EFF\u6EEC\u6EC5\u6EFE\u6F64\u71D2\u71B1\u7159\u7121\u723E\u7368\u7372\u7344\u746A\u76E1\u76DC\u775C\u77EF\u78DA\u79A6\u79AA\u7A40\u7AA9\u7C3D\u7C4C\u7CFE\u7D10\u7D21\u7D2E\u7D39\u7D66\u7D61\u7D81\u7DB1\u7DB5\u7DD2\u7DE9\u7DF4\u7E2E\u7E54\u7E73\u8056\u805E\u812B\u819A\u81A0\u81C9\u8271\u860B\u8755\u88E1\u8972\u89BD\u8A1F\u8A50\u8A8C\u8A98\u8AA0\u8AB0\u8AEE\u8B20\u8B1B\u8B5A\u8B9A\u8C93\u8C9D\u8C9E\u8CAB\u8CB4\u8CC0\u8CC8\u8CDC\u8CE6\u8D08\u8DE1\u8E10\u8EC0\u8ED2\u8EF8\u8F2F\u8F5F\u9023\u9031\u9055\u9059\u905E\u9072\u907C\u9081\u919C\u9234\u92D2\u92EA\u934B\u93C8\u9418\u9451\u9592\u95A3\u95A9\u95CA\u965D\u96B8\u96D6\u9727\u98E2\u990A\u9918\u99D0\u9A30\u9AD2\u9B31\u9B91\u9D3B\u512A\u511F\u5132\u5100\u5118\u50B3\u50BE\u50B5\u5049\u5074\u5075\u50D1\u5108\u5147\u514C\u5167\u518A\u51CD\u51F1\u522A\u5247\u525B\u5287\u5291\u52C1\u52DD\u52DE\u52F3\u537B\u5EC8\u53B2\u53C3\u53E2\u555F\u55AA\u559A\u55CE\u5617\u56D1\u63DB";
|
|
10
|
+
var SIMPLIFIED = "\u5E86\u5401\u6491\u76D8\u52B1\u529D\u6C47\u538C\u56E2\u6267\u575A\u62A5\u5757\u6D82\u575B\u5BFF\u5965\u5986\u5BA0\u53A8\u5F2F\u6C47\u5F7B\u6052\u6076\u607C\u7231\u60E8\u60EF\u8651\u5FE7\u51ED\u5BAA\u60E9\u60AC\u626B\u6302\u91C7\u626C\u635F\u6447\u62A2\u629A\u6324\u63B7\u62E2\u62E6\u6BD9\u65A9\u664B\u6653\u6652\u4E66\u680B\u4E50\u67A2\u673A\u53F0\u680F\u6B7C\u6BB4\u6C22\u6C61\u51B3\u6CA1\u51B2\u51B5\u6CC4\u51CF\u6D4B\u6D8C\u51C6\u6C9F\u6EDE\u6E10\u6D01\u6E83\u6CFD\u6D9B\u6EE5\u6FD2\u6EE9\u7089\u70C2\u5899\u727A\u72B6\u72B9\u72EE\u730E\u517D\u732E\u4EA9\u53E0\u75AF\u6108\u76CF\u7792\u7840\u7855\u7977\u7A0E\u79CD\u9896\u7A9C\u7A83\u8282\u7B51\u7B03\u5E18\u7B3C\u7B7E\u7CA4\u7CAA\u7EB9\u7EB3\u7EB7\u7F14\u7F05\u7EAC\u7F1D\u7EB5\u7ED5\u7ED8\u7CFB\u7F20\u7F06\u7F5A\u804C\u8038\u8109\u80BE\u80BF\u811A\u814A\u5367\u5E84\u534E\u83B1\u4E07\u53F6\u82CD\u76D6\u83B2\u8471\u836B\u8350\u8428\u836F\u82A6\u8574\u864F\u8681\u8721\u88E4\u8BCD\u5938\u8C0A\u8C05\u8C0D\u8C10\u8BBD\u8C0E\u8C1C\u8C26\u8C28\u8BA5\u8C34\u8A89\u7AD6\u732A\u8D26\u8D4C\u8D5A\u8D4E\u8D63\u8F89\u8F96\u8F7F\u8F9E\u8FA9\u56DE\u6E38\u9093\u915D\u9171\u917F\u9499\u94C0\u94F6\u94DC\u9510\u94DD\u9502\u8868\u70BC\u9551\u94BB\u95F8\u9600\u95EF\u9668\u97E7\u98A0\u98D9\u5582\u997F\u9A97\u677E\u9762\u9709\u8FD9\u4E2A\u4EEC\u6765\u65F6\u8BF4\u4F1A\u5BF9\u4E8E\u4E0E\u4E3A\u53D1\u5F00\u5173\u56FD\u5B66\u5E94\u8FC7\u8FD8\u8FDB\u7ECF\u70B9\u52A8\u5B9E\u73B0\u4ECE\u540E\u5F53\u4F53\u4E24\u4E1A\u52A1\u957F\u95E8\u95EE\u9898\u95F4\u5934\u4E49\u8F66\u7535\u8BDD\u5BFC\u6E7E\u53F0\u7F51\u7EBF\u533A\u8054\u603B\u7EDF\u515A\u9009\u4E3E\u8BAE\u5458\u53BF\u4E61\u573A\u4EF7\u94B1\u8D27\u5E01\u8D44\u4EA7\u8425\u989D\u6DA8\u53D8\u6570\u636E\u672F\u8111\u8F6F\u9669\u6C14\u6E29\u53F0\u98CE\u4E91\u6218\u4E89\u519B\u8230\u98DE\u5F39\u51FB\u536B\u62A4\u533B\u7597\u8BCA\u68C0\u786E\u961F\u8D5B\u8D62\u8F93\u8FD0\u8BA9\u8BA4\u8BC6\u8BBA\u89C6\u9891\u5E7F\u8BAF\u6743\u6B27\u4E1C\u9646\u5C9B\u53CC\u5355\u53F7\u7801\u67DC\u6269\u8BBE\u8BA1\u5212\u753B\u89C4\u8303\u6761\u7EA6\u8D39\u94C1\u6865\u706F\u697C\u5382\u77FF\u519C\u6E14\u5236\u8BED\u8BFE\u8BD5\u7EA7\u7C7B\u4E70\u5356\u8D2D\u73AF\u6001\u52BF\u89C2\u8BE2\u542C\u8BFB\u5199\u529E\u5904\u4E25\u590D\u5174\u82CF\u968F\u6837\u4EC5\u51E0\u4EBF\u8F86\u51B2\u707E\u96BE\u4F24\u5C5E\u7F62\u7ED3\u534F\u5C81\u9F84\u513F\u5B59\u5987\u5E08\u7EAA\u5F55\u521B\u53EA\u9636\u5C42\u5F20\u9648\u5218\u6768\u9EC4\u8D75\u5434\u8BB8\u90D1\u8C22\u7F57\u51AF\u848B\u97E9\u9F9A\u4E60\u8D56\u9A6C\u8427\u97E6\u987E\u95ED\u95EA\u9605\u677F\u9633\u9634\u9645\u9690\u6742\u9E21\u79BB\u7075\u9759\u54CD\u9875\u9879\u987A\u987B\u9884\u9886\u9897\u989C\u613F\u663E\u996D\u996E\u9986\u9976\u9A7E\u9A8C\u9A91\u60CA\u53D1\u6597\u9C7C\u9C9C\u9E1F\u9E23\u9EA6\u9F50\u9F7F\u9F99\u9F9F\u6BD5\u5F02\u76D1\u5362\u4F17\u56F0\u788D\u793C\u7978\u79F0\u79EF\u7A33\u7A77\u7ADE\u7B14\u7B80\u7BEE\u7CAE\u7EA2\u7EAF\u7EB8\u7EC6\u7EC8\u7EC4\u7EDD\u4E1D\u7EFF\u7EF4\u7EFC\u7D27\u7F16\u7F18\u7EE9\u7EE7\u7EED\u9A82\u58F0\u8083\u80C1\u80C6\u810F\u4E34\u65E7\u8231\u827A\u84DD\u5170\u865A\u866B\u88C5\u8865\u590D\u89C1\u4EB2\u89C9\u89E6\u8BA2\u8BA8\u8BAD\u6258\u8BB0\u8BBF\u8BC9\u8BC1\u8BC4\u8BD7\u8BE5\u8BE6\u8BDE\u8BEF\u8C03\u8C08\u8BF7\u8BFA\u8C0B\u8C13\u8BC1\u8C31\u8BD1\u4E30\u8D1F\u8D22\u8D21\u8D2B\u8D29\u8D2A\u8D23\u8D37\u8D34\u8D38\u8D3C\u5BBE\u8D54\u8D4F\u8D24\u8D28\u8D5E\u8D76\u8D8B\u8E2A\u8DC3\u8F68\u8F83\u8F7D\u8F85\u8F7B\u8F88\u8F6E\u8F6C\u8FBE\u8FC1\u8FDC\u9002\u9057\u8FB9\u90AE\u90BB\u91CA\u9488\u9493\u949E\u94A2\u9526\u9519\u952E\u9501\u9547\u955C\u9635\u96F3\u9876\u9881\u987F\u9887\u9888\u98D3\u98D8\u9A71\u95F9\u9C81\u51E4\u4E3D\u5E9E\u56FE\u56ED\u56F4\u5706\u538B\u574F\u575D\u58EE\u5907\u591F\u4F19\u68A6\u593A\u5956\u594B\u5988\u5A74\u5B81\u5BA1\u5BBD\u5B9D\u5C06\u4E13\u5BFB\u5C4A\u5188\u5C7F\u5C97\u5CE1\u5E05\u5E10\u5E26\u5E2E\u5E72\u5385\u5E9F\u5E99\u5F66\u5F3A\u5F52\u5F84\u5F81\u604B\u620F\u6237\u62E5\u62E9\u6321\u62C5\u6270\u643A\u6444\u62E8\u62DF\u6446\u644A\u8D25\u53D9\u654C\u655B\u65AD\u6682\u5386\u6781\u6784\u67AA\u6807\u6A2A\u6863\u6811\u6B22\u5386\u6B8B\u6740\u58F3\u6BC1\u6C49\u6F5C\u6D4E\u6EE8\u6D53\u6E7F\u6EE1\u6CAA\u706D\u6EDA\u6DA6\u70E7\u70ED\u70DF\u65E0\u5C14\u72EC\u83B7\u72F1\u739B\u5C3D\u76D7\u7741\u77EB\u7816\u5FA1\u7985\u8C37\u7A9D\u7B7E\u7B79\u7EA0\u7EBD\u7EBA\u624E\u7ECD\u7ED9\u7EDC\u7ED1\u7EB2\u5F69\u7EEA\u7F13\u7EC3\u7F29\u7EC7\u7F34\u5723\u95FB\u8131\u80A4\u80F6\u8138\u8270\u82F9\u8680\u91CC\u88AD\u89C8\u8BBC\u8BC8\u5FD7\u8BF1\u8BDA\u8C01\u54A8\u8C23\u8BB2\u8C2D\u8D5E\u732B\u8D1D\u8D1E\u8D2F\u8D35\u8D3A\u8D3E\u8D50\u8D4B\u8D60\u8FF9\u8DF5\u8EAF\u8F69\u8F74\u8F91\u8F70\u8FDE\u5468\u8FDD\u9065\u9012\u8FDF\u8FBD\u8FC8\u4E11\u94C3\u950B\u94FA\u9505\u94FE\u949F\u9274\u95F2\u9601\u95FD\u9614\u9655\u96B6\u867D\u96FE\u9965\u517B\u4F59\u9A7B\u817E\u810F\u90C1\u9C8D\u9E3F\u4F18\u507F\u50A8\u4EEA\u5C3D\u4F20\u503E\u503A\u4F1F\u4FA7\u4FA6\u4FA8\u4FA9\u51F6\u5151\u5185\u518C\u51BB\u51EF\u5220\u5219\u521A\u5267\u5242\u52B2\u80DC\u52B3\u52CB\u5374\u53A6\u5389\u53C2\u4E1B\u542F\u4E27\u5524\u5417\u5C1D\u5631\u6362";
|
|
11
|
+
var T2S = /* @__PURE__ */ new Map();
|
|
12
|
+
{
|
|
13
|
+
const t2 = [...TRADITIONAL];
|
|
14
|
+
const s = [...SIMPLIFIED];
|
|
15
|
+
for (let i = 0; i < t2.length; i += 1) T2S.set(t2[i], s[i]);
|
|
16
|
+
}
|
|
17
|
+
function foldHan(text) {
|
|
18
|
+
let out = "";
|
|
19
|
+
for (const ch of text) out += T2S.get(ch) ?? ch;
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
|
|
8
23
|
// src/cluster.ts
|
|
9
24
|
var SAME_STORY = 0.6;
|
|
10
25
|
var MIN_BAG = 5;
|
|
@@ -55,22 +70,209 @@ var STOPWORDS = /* @__PURE__ */ new Set([
|
|
|
55
70
|
"after",
|
|
56
71
|
"over",
|
|
57
72
|
"into",
|
|
58
|
-
"says"
|
|
73
|
+
"says",
|
|
74
|
+
"eine",
|
|
75
|
+
"einen",
|
|
76
|
+
"einem",
|
|
77
|
+
"einer",
|
|
78
|
+
"eines",
|
|
79
|
+
"nach",
|
|
80
|
+
"nicht",
|
|
81
|
+
"sich",
|
|
82
|
+
"sind",
|
|
83
|
+
"wird",
|
|
84
|
+
"werden",
|
|
85
|
+
"wurde",
|
|
86
|
+
"auch",
|
|
87
|
+
"noch",
|
|
88
|
+
"oder",
|
|
89
|
+
"aber",
|
|
90
|
+
"uber",
|
|
91
|
+
"unter",
|
|
92
|
+
"gegen",
|
|
93
|
+
"mehr",
|
|
94
|
+
"soll",
|
|
95
|
+
"sollen",
|
|
96
|
+
"kann",
|
|
97
|
+
"konnen",
|
|
98
|
+
"haben",
|
|
99
|
+
"dass",
|
|
100
|
+
"wenn",
|
|
101
|
+
"beim",
|
|
102
|
+
"gibt",
|
|
103
|
+
"jetzt",
|
|
104
|
+
"schon",
|
|
105
|
+
"diese",
|
|
106
|
+
"dieser",
|
|
107
|
+
"dieses",
|
|
108
|
+
"sein",
|
|
109
|
+
"seine",
|
|
110
|
+
"ihre",
|
|
111
|
+
"wieder"
|
|
59
112
|
]);
|
|
113
|
+
var CJK = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af\uf900-\ufaff]/;
|
|
114
|
+
var CJK_RUNS = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af\uf900-\ufaff]+/g;
|
|
115
|
+
var THOUSANDS = /(\d),(?=\d{3}(?!\d))/g;
|
|
116
|
+
var CJK_ALL = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af\uf900-\ufaff]/g;
|
|
117
|
+
var CJK_STOPWORDS = /* @__PURE__ */ new Set([
|
|
118
|
+
"\u4ECA\u5929",
|
|
119
|
+
"\u660E\u5929",
|
|
120
|
+
"\u6628\u5929",
|
|
121
|
+
"\u4ECA\u65E5",
|
|
122
|
+
"\u660E\u65E5",
|
|
123
|
+
"\u6628\u65E5",
|
|
124
|
+
"\u4ECA\u5E74",
|
|
125
|
+
"\u660E\u5E74",
|
|
126
|
+
"\u53BB\u5E74",
|
|
127
|
+
"\u4ECA\u665A",
|
|
128
|
+
"\u65E5\u524D",
|
|
129
|
+
"\u8FD1\u65E5",
|
|
130
|
+
"\u672C\u5468",
|
|
131
|
+
"\u4E0A\u5468",
|
|
132
|
+
"\u4E0B\u5468",
|
|
133
|
+
"\u5BA3\u5E03",
|
|
134
|
+
"\u8868\u793A",
|
|
135
|
+
"\u6307\u51FA",
|
|
136
|
+
"\u8BA4\u4E3A",
|
|
137
|
+
"\u5F3A\u8C03",
|
|
138
|
+
"\u56DE\u5E94",
|
|
139
|
+
"\u900F\u9732",
|
|
140
|
+
"\u53D1\u5E03",
|
|
141
|
+
"\u53D1\u8868",
|
|
142
|
+
"\u516C\u5E03",
|
|
143
|
+
"\u63D0\u51FA",
|
|
144
|
+
"\u8FDB\u884C",
|
|
145
|
+
"\u53EF\u80FD",
|
|
146
|
+
"\u5DF2\u7ECF",
|
|
147
|
+
"\u76EE\u524D",
|
|
148
|
+
"\u6B63\u5F0F",
|
|
149
|
+
"\u5C06\u4E8E",
|
|
150
|
+
"\u662F\u5426",
|
|
151
|
+
"\u5982\u4F55",
|
|
152
|
+
"\u4EC0\u4E48",
|
|
153
|
+
"\u4E3A\u4F55",
|
|
154
|
+
"\u6211\u4EEC",
|
|
155
|
+
"\u4ED6\u4EEC",
|
|
156
|
+
"\u4E00\u4E2A",
|
|
157
|
+
"\u8FD9\u4E2A",
|
|
158
|
+
"\u6CA1\u6709",
|
|
159
|
+
"\u4E0D\u662F",
|
|
160
|
+
"\u6700\u65B0",
|
|
161
|
+
"\u5FEB\u8BAF",
|
|
162
|
+
"\u72EC\u5BB6",
|
|
163
|
+
"\u91CD\u78C5",
|
|
164
|
+
"\u8BB0\u8005",
|
|
165
|
+
"\u62A5\u5BFC",
|
|
166
|
+
"\u62A5\u9053",
|
|
167
|
+
"\u65B0\u95FB",
|
|
168
|
+
"\u5F71\u97F3",
|
|
169
|
+
"\u89C6\u9891",
|
|
170
|
+
"\u56FE\u96C6"
|
|
171
|
+
]);
|
|
172
|
+
function isCjk(title) {
|
|
173
|
+
return CJK.test(title);
|
|
174
|
+
}
|
|
175
|
+
function titleTerms(title) {
|
|
176
|
+
const lower = title.toLowerCase();
|
|
177
|
+
if (!CJK.test(lower)) return latinTerms(lower, false);
|
|
178
|
+
const folded = foldHan(withoutLabels(lower)).replace(THOUSANDS, "$1");
|
|
179
|
+
const out = [];
|
|
180
|
+
for (const run of folded.match(CJK_RUNS) ?? []) {
|
|
181
|
+
const chars = [...run];
|
|
182
|
+
if (chars.length === 1) out.push(run);
|
|
183
|
+
for (let i = 0; i + 1 < chars.length; i++) {
|
|
184
|
+
const pair = chars[i] + chars[i + 1];
|
|
185
|
+
if (!CJK_STOPWORDS.has(pair)) out.push(pair);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
out.push(...latinTerms(folded.replace(CJK_ALL, " "), true));
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
function latinTerms(lower, inCjk) {
|
|
192
|
+
const out = [];
|
|
193
|
+
let text = lower.replace(/ß/g, "ss").normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
194
|
+
if (inCjk) text = text.replace(/(\d)\.(?=\d)/g, "$1_");
|
|
195
|
+
for (const w of text.replace(inCjk ? /[^a-z0-9_\s]/g : /[^a-z0-9\s]/g, " ").split(/\s+/)) {
|
|
196
|
+
if (w.length >= (inCjk ? 2 : 4) && !STOPWORDS.has(w)) out.push(w.replace(/_/g, "."));
|
|
197
|
+
}
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
60
200
|
function titleBag(title) {
|
|
61
|
-
return new Set(
|
|
62
|
-
|
|
63
|
-
|
|
201
|
+
return new Set(titleTerms(title));
|
|
202
|
+
}
|
|
203
|
+
function compactTitle(title) {
|
|
204
|
+
return foldHan(withoutLabels(title).toLowerCase().normalize("NFC")).replace(/[^\p{L}\p{N}]/gu, "");
|
|
64
205
|
}
|
|
65
206
|
function overlap(a, b) {
|
|
66
207
|
const min = Math.min(a.size, b.size);
|
|
67
208
|
if (min === 0) return 0;
|
|
209
|
+
return sharedTerms(a, b) / min;
|
|
210
|
+
}
|
|
211
|
+
function sharedTerms(a, b) {
|
|
68
212
|
let shared2 = 0;
|
|
69
213
|
for (const w of a) if (b.has(w)) shared2 += 1;
|
|
70
|
-
return shared2
|
|
214
|
+
return shared2;
|
|
215
|
+
}
|
|
216
|
+
var CJK_LABEL = /^\s*(?:[[【〔((][^\]】〕))]{1,6}[\]】〕))]|[^\s》//||]{1,4}[》//||])\s*/u;
|
|
217
|
+
function withoutLabels(title) {
|
|
218
|
+
let t2 = title;
|
|
219
|
+
for (let k = 0; k < 2; k += 1) {
|
|
220
|
+
const m = CJK_LABEL.exec(t2);
|
|
221
|
+
if (!m || m[0].length >= t2.length) break;
|
|
222
|
+
t2 = t2.slice(m[0].length);
|
|
223
|
+
}
|
|
224
|
+
return t2;
|
|
225
|
+
}
|
|
226
|
+
function cjkTokens(title) {
|
|
227
|
+
return foldHan(withoutLabels(title).toLowerCase()).replace(THOUSANDS, "$1").match(new RegExp("[a-z0-9]+(?:\\.[0-9]+)*|(?![a-z])\\p{L}", "gu")) ?? [];
|
|
228
|
+
}
|
|
229
|
+
function alignmentGaps(x, y) {
|
|
230
|
+
const n = x.length;
|
|
231
|
+
const m = y.length;
|
|
232
|
+
const lcs = Array.from({ length: n + 1 }, () => new Array(m + 1).fill(0));
|
|
233
|
+
for (let i2 = n - 1; i2 >= 0; i2 -= 1) {
|
|
234
|
+
for (let j2 = m - 1; j2 >= 0; j2 -= 1) lcs[i2][j2] = x[i2] === y[j2] ? lcs[i2 + 1][j2 + 1] + 1 : Math.max(lcs[i2 + 1][j2], lcs[i2][j2 + 1]);
|
|
235
|
+
}
|
|
236
|
+
const gaps = [];
|
|
237
|
+
let ga = [];
|
|
238
|
+
let gb = [];
|
|
239
|
+
let i = 0;
|
|
240
|
+
let j = 0;
|
|
241
|
+
const close = () => {
|
|
242
|
+
if (ga.length || gb.length) gaps.push({ a: ga, b: gb, start: i === ga.length && j === gb.length });
|
|
243
|
+
ga = [];
|
|
244
|
+
gb = [];
|
|
245
|
+
};
|
|
246
|
+
while (i < n && j < m) {
|
|
247
|
+
if (x[i] === y[j]) {
|
|
248
|
+
close();
|
|
249
|
+
i += 1;
|
|
250
|
+
j += 1;
|
|
251
|
+
} else if (lcs[i + 1][j] >= lcs[i][j + 1]) ga.push(x[i++]);
|
|
252
|
+
else gb.push(y[j++]);
|
|
253
|
+
}
|
|
254
|
+
ga.push(...x.slice(i));
|
|
255
|
+
gb.push(...y.slice(j));
|
|
256
|
+
close();
|
|
257
|
+
return { common: lcs[0][0], gaps };
|
|
258
|
+
}
|
|
259
|
+
var SLOT_MAX = 6;
|
|
260
|
+
var isSwap = (g, max) => g.a.length > 0 && g.b.length > 0 && g.a.length <= max && g.b.length <= max && !g.a.some((t2) => g.b.includes(t2));
|
|
261
|
+
function swappedSlots(a, b) {
|
|
262
|
+
const { common, gaps } = alignmentGaps(cjkTokens(a), cjkTokens(b));
|
|
263
|
+
if (common < 4 || gaps.length === 0) return false;
|
|
264
|
+
if (gaps.length <= 3 && gaps.every((g) => isSwap(g, SLOT_MAX))) return true;
|
|
265
|
+
const first = gaps[0];
|
|
266
|
+
return first.start && isSwap(first, 3) && first.a.length >= 2 && first.b.length >= 2;
|
|
267
|
+
}
|
|
268
|
+
var SAME_STORY_CJK = 0.4;
|
|
269
|
+
var CJK_MIN_SHARED = 4;
|
|
270
|
+
function sameStory(a, b, threshold = SAME_STORY) {
|
|
271
|
+
if (!isCjk(a.title) && !isCjk(b.title)) return overlap(a.bag, b.bag) >= threshold;
|
|
272
|
+
return sharedTerms(a.bag, b.bag) >= CJK_MIN_SHARED && overlap(a.bag, b.bag) >= SAME_STORY_CJK && !swappedSlots(a.title, b.title);
|
|
71
273
|
}
|
|
72
274
|
function clusterStories(items, threshold = SAME_STORY, minBag = MIN_BAG) {
|
|
73
|
-
const bags = items.map((it) => ({ it, bag: titleBag(it.title) }));
|
|
275
|
+
const bags = items.map((it) => ({ it, title: it.title, bag: titleBag(it.title) }));
|
|
74
276
|
const taken = new Array(bags.length).fill(false);
|
|
75
277
|
const out = [];
|
|
76
278
|
for (let i = 0; i < bags.length; i += 1) {
|
|
@@ -84,7 +286,7 @@ function clusterStories(items, threshold = SAME_STORY, minBag = MIN_BAG) {
|
|
|
84
286
|
const other = bags[j];
|
|
85
287
|
if (other.bag.size < minBag) continue;
|
|
86
288
|
if (other.it.source === head.it.source) continue;
|
|
87
|
-
if (
|
|
289
|
+
if (sameStory(head, other, threshold)) {
|
|
88
290
|
group.push(other.it);
|
|
89
291
|
taken[j] = true;
|
|
90
292
|
}
|
|
@@ -96,7 +298,7 @@ function clusterStories(items, threshold = SAME_STORY, minBag = MIN_BAG) {
|
|
|
96
298
|
return out;
|
|
97
299
|
}
|
|
98
300
|
function publisherOf(source) {
|
|
99
|
-
return source.replace(/ (?:IA|AI)$/, "");
|
|
301
|
+
return source.replace(/ (?:IA|AI|KI)$/, "");
|
|
100
302
|
}
|
|
101
303
|
function contrastPair(story, maxOverlap = CONTRAST_MAX) {
|
|
102
304
|
if (story.items.length < 2) return null;
|
|
@@ -115,22 +317,72 @@ function contrastPair(story, maxOverlap = CONTRAST_MAX) {
|
|
|
115
317
|
}
|
|
116
318
|
|
|
117
319
|
// src/defaults.ts
|
|
118
|
-
var AI_TITLE_FILTER = "\\b(?:[Aa]nthropic|[Cc]laude|[Cc]hat[Gg]PT|[Oo]pen[Aa][Ii]|[Gg]emini|[Dd]eep[Mm]ind|[Cc]opilot|[Mm]idjourney|[Dd]eep[Ss]eek|[Mm]istral [Aa][Ii]|[Pp]erplexity|[Ll]lama \\d|[Gg]rok|inteligencia artificial|IA|IAs|AI|LLMs?|chatbots?|modelo de lenguaje|language model|red neuronal|neural network|superinteligencia)\\b";
|
|
320
|
+
var AI_TITLE_FILTER = "\\b(?:[Aa]nthropic|[Cc]laude|[Cc]hat[Gg]PT|[Oo]pen[Aa][Ii]|[Gg]emini|[Dd]eep[Mm]ind|[Cc]opilot|[Mm]idjourney|[Dd]eep[Ss]eek|[Mm]istral [Aa][Ii]|[Pp]erplexity|[Ll]lama \\d|[Gg]rok|[Qq]wen|[Kk]imi|inteligencia artificial|IA|IAs|AI|AGI|AIGC|LLMs?|chatbots?|modelo de lenguaje|language model|red neuronal|neural network|superinteligencia)\\b|\\b(?:KI|KIs|[Kk]\xFCnstlichen? Intelligenz|Sprachmodell(?:e|en|s)?|[Nn]euronale[ns]? Netz(?:e|en|werk)?|Superintelligenz)\\b|\u4EBA\u5DE5\u667A\u6167|\u4EBA\u5DE5\u667A\u80FD|\u5927\u6A21\u578B|\u8A9E\u8A00\u6A21\u578B|\u8BED\u8A00\u6A21\u578B|\u751F\u6210\u5F0F|\u6A5F\u5668\u5B78\u7FD2|\u673A\u5668\u5B66\u4E60|\u6DF1\u5EA6\u5B78\u7FD2|\u6DF1\u5EA6\u5B66\u4E60|\u795E\u7D93\u7DB2\u8DEF|\u795E\u7ECF\u7F51\u7EDC|\u804A\u5929\u6A5F\u5668\u4EBA|\u804A\u5929\u673A\u5668\u4EBA|\u667A\u80FD\u9AD4|\u667A\u80FD\u4F53|\u8D85\u7D1A\u667A\u6167|\u8D85\u7EA7\u667A\u80FD|\u901A\u7FA9|\u901A\u4E49|\u5343\u554F|\u5343\u95EE|\u6587\u5FC3\u4E00\u8A00|\u8C46\u5305|\u667A\u8B5C|\u667A\u8C31|\u6708\u4E4B\u6697\u9762|\u6DF7\u5143\u5927\u6A21\u578B";
|
|
119
321
|
var HOUR = 36e5;
|
|
120
322
|
var AI_MAX_AGE_MS = 36 * HOUR;
|
|
121
323
|
var DEFAULT_MAX_AGE_MS = 72 * HOUR;
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
324
|
+
var ai = (name, url) => ({ name, url, titleFilter: AI_TITLE_FILTER, maxAgeMs: AI_MAX_AGE_MS });
|
|
325
|
+
var DEFAULT_FEEDS_BY_LANGUAGE = {
|
|
326
|
+
es: [
|
|
327
|
+
ai("Xataka IA", "https://feeds.weblogssl.com/xataka2"),
|
|
328
|
+
ai("Hipertextual IA", "https://hipertextual.com/feed"),
|
|
329
|
+
ai("20minutos IA", "https://www.20minutos.es/rss/tecnologia/"),
|
|
330
|
+
ai("Omicrono IA", "https://www.elespanol.com/rss/omicrono/"),
|
|
331
|
+
{ name: "elDiario.es", url: "https://www.eldiario.es/rss/" },
|
|
332
|
+
{ name: "20minutos", url: "https://www.20minutos.es/rss/" },
|
|
333
|
+
{ name: "El Pa\xEDs", url: "https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/portada" },
|
|
334
|
+
{ name: "La Vanguardia", url: "https://www.lavanguardia.com/rss/home.xml" },
|
|
335
|
+
{ name: "El Mundo", url: "https://e00-elmundo.uecdn.es/elmundo/rss/portada.xml" },
|
|
336
|
+
{ name: "ABC", url: "https://www.abc.es/rss/2.0/portada/" }
|
|
337
|
+
],
|
|
338
|
+
en: [
|
|
339
|
+
ai("The Verge AI", "https://www.theverge.com/rss/ai-artificial-intelligence/index.xml"),
|
|
340
|
+
ai("Ars Technica AI", "https://feeds.arstechnica.com/arstechnica/index"),
|
|
341
|
+
ai("The Guardian AI", "https://www.theguardian.com/technology/rss"),
|
|
342
|
+
ai("Wired AI", "https://www.wired.com/feed/tag/ai/latest/rss"),
|
|
343
|
+
{ name: "BBC News", url: "https://feeds.bbci.co.uk/news/world/rss.xml" },
|
|
344
|
+
{ name: "The Guardian", url: "https://www.theguardian.com/world/rss" },
|
|
345
|
+
{ name: "NPR", url: "https://feeds.npr.org/1001/rss.xml" },
|
|
346
|
+
{ name: "ABC News", url: "https://abcnews.go.com/abcnews/internationalheadlines" }
|
|
347
|
+
],
|
|
348
|
+
// Germany. Topic feeds are named "<Outlet> KI", German for AI. Golem and
|
|
349
|
+
// Deutsche Welle carry no photo in their feed; n-tv's and Der Standard's
|
|
350
|
+
// are thumbnails (250 and 150 px wide).
|
|
351
|
+
de: [
|
|
352
|
+
ai("heise KI", "https://www.heise.de/thema/Kuenstliche-Intelligenz.xml"),
|
|
353
|
+
ai("t3n KI", "https://t3n.de/rss.xml"),
|
|
354
|
+
ai("Spiegel KI", "https://www.spiegel.de/netzwelt/index.rss"),
|
|
355
|
+
{ name: "tagesschau", url: "https://www.tagesschau.de/index~rss2.xml" },
|
|
356
|
+
{ name: "Spiegel", url: "https://www.spiegel.de/schlagzeilen/index.rss" },
|
|
357
|
+
{ name: "Zeit Online", url: "https://newsfeed.zeit.de/index" },
|
|
358
|
+
{ name: "S\xFCddeutsche", url: "https://rss.sueddeutsche.de/rss/Topthemen" },
|
|
359
|
+
{ name: "FAZ", url: "https://www.faz.net/rss/aktuell/" },
|
|
360
|
+
{ name: "stern", url: "https://www.stern.de/feed/standard/alle-nachrichten/" }
|
|
361
|
+
],
|
|
362
|
+
// Taiwan.
|
|
363
|
+
"zh-Hant": [
|
|
364
|
+
ai("\u79D1\u6280\u5831\u6A58 AI", "https://buzzorange.com/techorange/feed/"),
|
|
365
|
+
ai("INSIDE AI", "https://www.inside.com.tw/feed/rss"),
|
|
366
|
+
ai("T\u5BA2\u90A6 AI", "https://www.techbang.com/posts.rss"),
|
|
367
|
+
{ name: "ETtoday", url: "https://feeds.feedburner.com/ettoday/realtime" },
|
|
368
|
+
{ name: "\u93E1\u9031\u520A", url: "https://www.mirrormedia.mg/rss/news.xml" },
|
|
369
|
+
{ name: "\u65B0\u982D\u6BBC", url: "https://newtalk.tw/rss/all" },
|
|
370
|
+
{ name: "\u95DC\u9375\u8A55\u8AD6\u7DB2", url: "https://feeds.feedburner.com/TheNewsLens" }
|
|
371
|
+
],
|
|
372
|
+
// Mainland outlets, reachable from there. Few mainland papers keep an RSS
|
|
373
|
+
// with photos (澎湃 has none, 新华网 and 中新网 no photos), so it leans to technology.
|
|
374
|
+
"zh-Hans": [
|
|
375
|
+
ai("IT\u4E4B\u5BB6 AI", "https://www.ithome.com/rss/"),
|
|
376
|
+
ai("\u96F7\u950B\u7F51 AI", "https://www.leiphone.com/feed"),
|
|
377
|
+
{ name: "36\u6C2A", url: "https://www.36kr.com/feed" },
|
|
378
|
+
{ name: "\u949B\u5A92\u4F53", url: "https://www.tmtpost.com/rss.xml" },
|
|
379
|
+
{ name: "\u7231\u8303\u513F", url: "https://www.ifanr.com/feed" },
|
|
380
|
+
{ name: "\u6781\u5BA2\u516C\u56ED", url: "https://www.geekpark.net/rss" }
|
|
381
|
+
]
|
|
382
|
+
};
|
|
383
|
+
function defaultFeeds(language) {
|
|
384
|
+
return DEFAULT_FEEDS_BY_LANGUAGE[language] ?? DEFAULT_FEEDS_BY_LANGUAGE.en;
|
|
385
|
+
}
|
|
134
386
|
var JUNK_TITLE_FILTER = [
|
|
135
387
|
// Advertorials and affiliates.
|
|
136
388
|
"\\b(?:amazon|aliexpress|chollo|descuentazo|superventas|el corte ingl[e\xE9]s",
|
|
@@ -155,11 +407,36 @@ var JUNK_TITLE_FILTER = [
|
|
|
155
407
|
// "Name, job: «quote»" — filler testimonials.
|
|
156
408
|
`|^[a-z\xE1\xE9\xED\xF3\xFA\xF1]+, [a-z\xE1\xE9\xED\xF3\xFA\xF1 ]{3,28}: ["\u201C']`,
|
|
157
409
|
// "Las 7 claves de…", "Los 5 trucos para…"
|
|
158
|
-
"|^(?:las?|los?) \\d+ (?:claves|cosas|razones|trucos|mejores|secretos|motivos)\\b"
|
|
410
|
+
"|^(?:las?|los?) \\d+ (?:claves|cosas|razones|trucos|mejores|secretos|motivos)\\b",
|
|
411
|
+
// German, same purposes and the same caution ("Angebot" alone is real
|
|
412
|
+
// economy news, "Ticker" a real market report). Advertorials and deals.
|
|
413
|
+
"|^anzeige:|\\b(?:gutscheincode|rabattcode|schn[\xE4a]ppchen|deal des tages|angebot des tages|jetzt (?:g[\xFCu]nstig|reduziert))\\b",
|
|
414
|
+
// Lottery and horoscopes.
|
|
415
|
+
"|\\b(?:lottozahlen|eurojackpot|gewinnzahlen|gl[\xFCu]cksspirale|horoskop|tageshoroskop)\\b",
|
|
416
|
+
// Galleries and live blogs (German live tickers often open with +++).
|
|
417
|
+
"|\\b(?:in bildern|bildergalerie|fotostrecke|im liveticker|im live-ticker|liveblog|im newsblog)\\b|^\\+\\+\\+",
|
|
418
|
+
// Listicles: "Die 7 besten…", "10 Dinge, die…".
|
|
419
|
+
"|^(?:die )?\\d+ (?:besten|dinge|tipps|tricks|gr[\xFCu]nde)\\b",
|
|
420
|
+
// Chinese, Taiwan's and the mainland's words, without \b (it never matches
|
|
421
|
+
// between Han characters). Same purposes, same caution: 快訊 is a real
|
|
422
|
+
// breaking story in Taiwan and 雙11 a real economy one in the mainland.
|
|
423
|
+
// Advertorials and deals.
|
|
424
|
+
"|\u512A\u60E0\u78BC|\u4F18\u60E0\u7801|\u6298\u6263\u78BC|\u6298\u6263\u7801|\u9650\u6642\u512A\u60E0|\u9650\u65F6\u4F18\u60E0|\u597D\u7269\u63A8\u85A6|\u597D\u7269\u63A8\u8350|\u5FC5\u8CB7|\u5FC5\u4E70",
|
|
425
|
+
// Draws, horoscopes and fortune-telling.
|
|
426
|
+
"|\u5A01\u529B\u5F69|\u5927\u6A02\u900F|\u5927\u4E50\u900F|\u4ECA\u5F69539|\u7D71\u4E00\u767C\u7968|\u4E2D\u734E\u865F\u78BC|\u4E2D\u5956\u53F7\u7801|\u96D9\u8272\u7403|\u53CC\u8272\u7403|\u5F69\u7968\u958B\u734E|\u5F69\u7968\u5F00\u5956",
|
|
427
|
+
"|\u661F\u5EA7\u904B\u52E2|\u661F\u5EA7\u8FD0\u52BF|\u751F\u8096\u904B\u52E2|\u751F\u8096\u8FD0\u52BF|\\d\u751F\u8096|\u5341\u4E8C\u751F\u8096|\u5854\u7F85|\u5854\u7F57|\u7D2B\u5FAE",
|
|
428
|
+
// Clickbait: what the netizens did, the one trick.
|
|
429
|
+
"|\u7DB2\u53CB(?:\u50BB\u773C|\u7B11\u7FFB|\u66B4\u52D5|\u70B8\u934B|\u72C2\u8B9A|\u9A5A\u5446)|\u7F51\u53CB(?:\u50BB\u773C|\u7B11\u7FFB|\u70B8\u9505|\u76F4\u547C|\u60CA\u5446)|\u9A5A\u5446\u4E86|\u60CA\u5446\u4E86|99%\u7684\u4EBA|\u4F60\u4E0D\u77E5\u9053\u7684|\u4E00\u62DB(?:\u641E\u5B9A|\u89E3\u6C7A|\u89E3\u51B3)",
|
|
430
|
+
// Galleries and virals.
|
|
431
|
+
"|\u5716\u8F2F|\u56FE\u96C6|\u7D44\u5716|\u7EC4\u56FE|\u7206\u7D05|\u7206\u7EA2|\u760B\u50B3|\u75AF\u4F20",
|
|
432
|
+
// Live blogs.
|
|
433
|
+
"|\u6587\u5B57\u76F4\u64AD|\u76F4\u64AD\u4E2D|\u5373\u6642\u66F4\u65B0|\u5B9E\u65F6\u66F4\u65B0|\u6301\u7E8C\u66F4\u65B0|\u6301\u7EED\u66F4\u65B0|\u3010\u76F4\u64AD\u3011|\u3010LIVE\u3011",
|
|
434
|
+
// Round-ups and lists.
|
|
435
|
+
"|\u61F6\u4EBA\u5305|\u61D2\u4EBA\u5305|\u5FC5\u770B|\u76E4\u9EDE|\u76D8\u70B9|\u63A8\u85A6\u6E05\u55AE|\u63A8\u8350\u6E05\u5355"
|
|
159
436
|
].join("");
|
|
160
437
|
|
|
161
438
|
// src/demo.ts
|
|
162
|
-
import { localize } from "@kiosko/sdk";
|
|
439
|
+
import { localize, pickLocale } from "@kiosko/sdk";
|
|
163
440
|
var MIN = 6e4;
|
|
164
441
|
function item(source, title, summary, scene, agoMin, now, slug) {
|
|
165
442
|
return { source, title, summary, image: `demo:${scene}`, link: `https://example.org/${slug}`, published: now - agoMin * MIN };
|
|
@@ -229,85 +506,285 @@ var EN = (now) => [
|
|
|
229
506
|
"open-model"
|
|
230
507
|
)
|
|
231
508
|
];
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
509
|
+
var ZH_HANT = (now) => [
|
|
510
|
+
item(
|
|
511
|
+
"\u7D00\u4E8B\u5831",
|
|
512
|
+
"\u6E2F\u53E3\u64F4\u5EFA\u8CA8\u6AC3\u78BC\u982D\uFF0C\u4E94\u5E74\u5167\u8CA8\u904B\u91CF\u53EF\u671B\u500D\u589E",
|
|
513
|
+
"\u5DE5\u7A0B\u660E\u5E74\u6625\u5929\u52D5\u5DE5\uFF0C\u586B\u6D77 40 \u516C\u9803\u4E26\u65B0\u589E\u516D\u5EA7\u8D77\u91CD\u6A5F\u3002\u6E2F\u52D9\u5C40\u4F30\u8A08\u65BD\u5DE5\u671F\u9593\u53EF\u5275\u9020 2,000 \u500B\u76F4\u63A5\u5C31\u696D\u6A5F\u6703\u3002",
|
|
514
|
+
"harbour",
|
|
515
|
+
12,
|
|
516
|
+
now,
|
|
517
|
+
"port-1"
|
|
518
|
+
),
|
|
519
|
+
item(
|
|
520
|
+
"\u6D77\u5CB8\u65E5\u5831",
|
|
521
|
+
"\u6E2F\u53E3\u64F4\u5EFA\u8CA8\u6AC3\u78BC\u982D \u62DA\u8CA8\u904B\u91CF\u500D\u589E",
|
|
522
|
+
"\u8A08\u756B\u65B0\u589E\u516D\u5EA7\u8D77\u91CD\u6A5F\u8207 40 \u516C\u9803\u586B\u6D77\u65B0\u751F\u5730\u3002",
|
|
523
|
+
"harbour",
|
|
524
|
+
25,
|
|
525
|
+
now,
|
|
526
|
+
"port-2"
|
|
527
|
+
),
|
|
528
|
+
item(
|
|
529
|
+
"\u65B0\u805E 24",
|
|
530
|
+
"\u6E2F\u53E3\u8CA8\u6AC3\u78BC\u982D\u64F4\u5EFA \u76EE\u6A19\u8CA8\u904B\u91CF\u500D\u589E",
|
|
531
|
+
"\u822A\u904B\u696D\u8005\u6B61\u8FCE\u9019\u9805\u6C7A\u5B9A\uFF1B\u9644\u8FD1\u5C45\u6C11\u8981\u6C42\u9032\u884C\u566A\u97F3\u8A55\u4F30\u3002",
|
|
532
|
+
"harbour",
|
|
533
|
+
41,
|
|
534
|
+
now,
|
|
535
|
+
"port-3"
|
|
536
|
+
),
|
|
537
|
+
item(
|
|
538
|
+
"\u65B0\u805E 24",
|
|
539
|
+
"\u8DE8\u5E74\u591C\u6377\u904B\u901A\u5BB5\u884C\u99DB",
|
|
540
|
+
"12 \u6708 31 \u65E5\u4E3B\u8981\u8DEF\u7DDA\u4E0D\u6536\u73ED\uFF0C\u51CC\u6668 1 \u9EDE\u5F8C\u6BCF 15 \u5206\u9418\u4E00\u73ED\u3002",
|
|
541
|
+
"city",
|
|
542
|
+
48,
|
|
543
|
+
now,
|
|
544
|
+
"metro"
|
|
545
|
+
),
|
|
546
|
+
item(
|
|
547
|
+
"\u7D00\u4E8B\u5831",
|
|
548
|
+
"\u9AD8\u539F\u98A8\u5834\u958B\u59CB\u767C\u96FB\uFF1A\u7B2C\u4E00\u671F\u53EF\u4F9B 9 \u842C\u6236\u7528\u96FB",
|
|
549
|
+
"\u76EE\u524D\u5DF2\u5B89\u88DD\u7684 32 \u5EA7\u98A8\u6A5F\u672C\u9031\u8D77\u4F75\u7DB2\u4F9B\u96FB\uFF1B\u7B2C\u4E8C\u671F\u5C07\u65BC 1 \u6708\u62DB\u6A19\u3002",
|
|
550
|
+
"field",
|
|
551
|
+
95,
|
|
552
|
+
now,
|
|
553
|
+
"wind-1"
|
|
554
|
+
),
|
|
555
|
+
item(
|
|
556
|
+
"\u6D77\u5CB8\u65E5\u5831",
|
|
557
|
+
"\u9AD8\u539F\u98A8\u5834\u5EF6\u5F8C\u767C\u96FB\uFF1A\u7B2C\u4E00\u671F\u51AC\u5B63\u624D\u53EF\u4F9B 9 \u842C\u6236",
|
|
558
|
+
"\u958B\u767C\u5546\u5C07\u5EF6\u8AA4\u6B78\u548E\u65BC\u8B8A\u58D3\u5668\u77ED\u7F3A\u3002",
|
|
559
|
+
"field",
|
|
560
|
+
130,
|
|
561
|
+
now,
|
|
562
|
+
"wind-2"
|
|
563
|
+
),
|
|
564
|
+
item(
|
|
565
|
+
"\u4ECA\u65E5\u79D1\u6280 AI",
|
|
566
|
+
"\u958B\u653E\u8A9E\u8A00\u6A21\u578B\u5728\u7A0B\u5F0F\u8A2D\u8A08\u4EFB\u52D9\u4E0A\u8FFD\u5E73\u5927\u578B\u6A21\u578B",
|
|
567
|
+
"\u5718\u968A\u516C\u958B\u6B0A\u91CD\u8207\u8A55\u6E2C\u8CC7\u6599\uFF1B\u5728\u7368\u7ACB\u6E2C\u8A66\u4E2D\u89E3\u51FA 71% \u7684\u984C\u76EE\uFF0C\u63A5\u8FD1\u5546\u7528\u7CFB\u7D71\u3002",
|
|
568
|
+
"city",
|
|
569
|
+
180,
|
|
570
|
+
now,
|
|
571
|
+
"open-model"
|
|
572
|
+
)
|
|
573
|
+
];
|
|
574
|
+
var ZH_HANS = (now) => [
|
|
575
|
+
item(
|
|
576
|
+
"\u7EAA\u4E8B\u62A5",
|
|
577
|
+
"\u6E2F\u53E3\u6269\u5EFA\u96C6\u88C5\u7BB1\u7801\u5934\uFF0C\u4E94\u5E74\u5185\u8D27\u8FD0\u91CF\u6709\u671B\u7FFB\u756A",
|
|
578
|
+
"\u5DE5\u7A0B\u660E\u5E74\u6625\u5929\u5F00\u5DE5\uFF0C\u586B\u6D77 40 \u516C\u9877\u5E76\u65B0\u589E\u516D\u53F0\u8D77\u91CD\u673A\u3002\u6E2F\u52A1\u5C40\u4F30\u8BA1\u65BD\u5DE5\u671F\u95F4\u5C06\u521B\u9020 2000 \u4E2A\u76F4\u63A5\u5C31\u4E1A\u5C97\u4F4D\u3002",
|
|
579
|
+
"harbour",
|
|
580
|
+
12,
|
|
581
|
+
now,
|
|
582
|
+
"port-1"
|
|
583
|
+
),
|
|
584
|
+
item(
|
|
585
|
+
"\u6D77\u5CB8\u65E5\u62A5",
|
|
586
|
+
"\u6E2F\u53E3\u6269\u5EFA\u96C6\u88C5\u7BB1\u7801\u5934 \u8D27\u8FD0\u91CF\u51B2\u523A\u7FFB\u756A",
|
|
587
|
+
"\u9879\u76EE\u65B0\u589E\u516D\u53F0\u8D77\u91CD\u673A\u548C 40 \u516C\u9877\u586B\u6D77\u7528\u5730\u3002",
|
|
588
|
+
"harbour",
|
|
589
|
+
25,
|
|
590
|
+
now,
|
|
591
|
+
"port-2"
|
|
592
|
+
),
|
|
593
|
+
item(
|
|
594
|
+
"\u65B0\u95FB 24",
|
|
595
|
+
"\u6E2F\u53E3\u96C6\u88C5\u7BB1\u7801\u5934\u6269\u5EFA \u76EE\u6807\u8D27\u8FD0\u91CF\u7FFB\u756A",
|
|
596
|
+
"\u822A\u8FD0\u516C\u53F8\u5BF9\u6B64\u8868\u793A\u6B22\u8FCE\uFF1B\u5468\u8FB9\u5C45\u6C11\u8981\u6C42\u5F00\u5C55\u566A\u58F0\u8BC4\u4F30\u3002",
|
|
597
|
+
"harbour",
|
|
598
|
+
41,
|
|
599
|
+
now,
|
|
600
|
+
"port-3"
|
|
601
|
+
),
|
|
602
|
+
item(
|
|
603
|
+
"\u65B0\u95FB 24",
|
|
604
|
+
"\u8DE8\u5E74\u591C\u5730\u94C1\u901A\u5BB5\u8FD0\u8425",
|
|
605
|
+
"12 \u6708 31 \u65E5\u4E3B\u8981\u7EBF\u8DEF\u4E0D\u505C\u8FD0\uFF0C\u51CC\u6668 1 \u70B9\u540E\u6BCF 15 \u5206\u949F\u4E00\u73ED\u3002",
|
|
606
|
+
"city",
|
|
607
|
+
48,
|
|
608
|
+
now,
|
|
609
|
+
"metro"
|
|
610
|
+
),
|
|
611
|
+
item(
|
|
612
|
+
"\u7EAA\u4E8B\u62A5",
|
|
613
|
+
"\u9AD8\u539F\u98CE\u7535\u573A\u5F00\u59CB\u53D1\u7535\uFF1A\u4E00\u671F\u53EF\u6EE1\u8DB3 9 \u4E07\u6237\u7528\u7535",
|
|
614
|
+
"\u76EE\u524D\u5DF2\u5B89\u88C5\u7684 32 \u53F0\u98CE\u673A\u672C\u5468\u8D77\u5E76\u7F51\u53D1\u7535\uFF1B\u4E8C\u671F\u5C06\u4E8E 1 \u6708\u62DB\u6807\u3002",
|
|
615
|
+
"field",
|
|
616
|
+
95,
|
|
617
|
+
now,
|
|
618
|
+
"wind-1"
|
|
619
|
+
),
|
|
620
|
+
item(
|
|
621
|
+
"\u6D77\u5CB8\u65E5\u62A5",
|
|
622
|
+
"\u9AD8\u539F\u98CE\u7535\u573A\u63A8\u8FDF\u53D1\u7535\uFF1A\u4E00\u671F\u51AC\u5B63\u624D\u53EF\u4F9B 9 \u4E07\u6237",
|
|
623
|
+
"\u5F00\u53D1\u5546\u5C06\u5EF6\u8BEF\u5F52\u548E\u4E8E\u53D8\u538B\u5668\u77ED\u7F3A\u3002",
|
|
624
|
+
"field",
|
|
625
|
+
130,
|
|
626
|
+
now,
|
|
627
|
+
"wind-2"
|
|
628
|
+
),
|
|
629
|
+
item(
|
|
630
|
+
"\u4ECA\u65E5\u79D1\u6280 AI",
|
|
631
|
+
"\u5F00\u6E90\u8BED\u8A00\u6A21\u578B\u5728\u7F16\u7A0B\u4EFB\u52A1\u4E0A\u8FFD\u5E73\u5927\u6A21\u578B",
|
|
632
|
+
"\u56E2\u961F\u516C\u5F00\u6743\u91CD\u548C\u8BC4\u6D4B\u6570\u636E\uFF1B\u5728\u72EC\u7ACB\u6D4B\u8BD5\u4E2D\u89E3\u51FA 71% \u7684\u9898\u76EE\uFF0C\u63A5\u8FD1\u5546\u7528\u7CFB\u7EDF\u3002",
|
|
633
|
+
"city",
|
|
634
|
+
180,
|
|
635
|
+
now,
|
|
636
|
+
"open-model"
|
|
637
|
+
)
|
|
638
|
+
];
|
|
639
|
+
var ES = (now) => [
|
|
640
|
+
item(
|
|
641
|
+
"La Cr\xF3nica",
|
|
642
|
+
"El puerto ampl\xEDa su terminal de contenedores y prev\xE9 duplicar el tr\xE1fico de mercanc\xEDas en cinco a\xF1os",
|
|
643
|
+
"La obra, que arrancar\xE1 en primavera, gana 40 hect\xE1reas al mar y a\xF1ade seis gr\xFAas. La autoridad portuaria calcula 2.000 empleos directos durante la construcci\xF3n.",
|
|
644
|
+
"harbour",
|
|
645
|
+
12,
|
|
646
|
+
now,
|
|
647
|
+
"puerto-1"
|
|
648
|
+
),
|
|
649
|
+
item(
|
|
650
|
+
"Diario Costa",
|
|
651
|
+
"El puerto ampl\xEDa la terminal de contenedores para duplicar el tr\xE1fico de mercanc\xEDas",
|
|
652
|
+
"El proyecto suma seis gr\xFAas y 40 hect\xE1reas ganadas al mar.",
|
|
653
|
+
"harbour",
|
|
654
|
+
25,
|
|
655
|
+
now,
|
|
656
|
+
"puerto-2"
|
|
657
|
+
),
|
|
658
|
+
item(
|
|
659
|
+
"Noticias 24",
|
|
660
|
+
"La terminal de contenedores del puerto crecer\xE1 para duplicar el tr\xE1fico de mercanc\xEDas",
|
|
661
|
+
"Las navieras celebran la decisi\xF3n; los vecinos piden un estudio de ruido.",
|
|
662
|
+
"harbour",
|
|
663
|
+
41,
|
|
664
|
+
now,
|
|
665
|
+
"puerto-3"
|
|
666
|
+
),
|
|
667
|
+
item(
|
|
668
|
+
"Noticias 24",
|
|
669
|
+
"El metro funcionar\xE1 toda la noche durante las fiestas de fin de a\xF1o",
|
|
670
|
+
"Las l\xEDneas principales abrir\xE1n sin interrupci\xF3n del 24 de diciembre al 6 de enero, con trenes cada quince minutos a partir de la una.",
|
|
671
|
+
"city",
|
|
672
|
+
48,
|
|
673
|
+
now,
|
|
674
|
+
"metro"
|
|
675
|
+
),
|
|
676
|
+
item(
|
|
677
|
+
"La Cr\xF3nica",
|
|
678
|
+
"Los molinos de la meseta ya producen: la primera fase del parque e\xF3lico abastecer\xE1 a 90.000 hogares",
|
|
679
|
+
"Los 32 aerogeneradores instalados hasta ahora vierten a la red desde esta semana; la segunda fase se licita en enero.",
|
|
680
|
+
"field",
|
|
681
|
+
95,
|
|
682
|
+
now,
|
|
683
|
+
"eolico-1"
|
|
684
|
+
),
|
|
685
|
+
item(
|
|
686
|
+
"Diario Costa",
|
|
687
|
+
"El parque e\xF3lico de la meseta empieza a producir con retraso: su primera fase llega a 90.000 hogares en invierno",
|
|
688
|
+
"Los promotores atribuyen la demora a la falta de transformadores.",
|
|
689
|
+
"field",
|
|
690
|
+
130,
|
|
691
|
+
now,
|
|
692
|
+
"eolico-2"
|
|
693
|
+
),
|
|
694
|
+
item(
|
|
695
|
+
"Tecnolog\xEDa Hoy IA",
|
|
696
|
+
"Un modelo de lenguaje abierto iguala a los grandes en tareas de programaci\xF3n",
|
|
697
|
+
"El equipo publica los pesos y los datos de evaluaci\xF3n; en pruebas independientes resuelve el 71% de los problemas, cerca de los sistemas comerciales.",
|
|
698
|
+
"city",
|
|
699
|
+
180,
|
|
700
|
+
now,
|
|
701
|
+
"modelo-abierto"
|
|
702
|
+
)
|
|
703
|
+
];
|
|
704
|
+
var DE = (now) => [
|
|
705
|
+
item(
|
|
706
|
+
"Die Chronik",
|
|
707
|
+
"Hafen erweitert sein Containerterminal und will den G\xFCterverkehr in f\xFCnf Jahren verdoppeln",
|
|
708
|
+
"Die Arbeiten beginnen im Fr\xFChjahr, gewinnen dem Meer 40 Hektar ab und bringen sechs Kr\xE4ne. Die Hafenbeh\xF6rde rechnet w\xE4hrend der Bauzeit mit 2.000 direkten Arbeitspl\xE4tzen.",
|
|
709
|
+
"harbour",
|
|
710
|
+
12,
|
|
711
|
+
now,
|
|
712
|
+
"hafen-1"
|
|
713
|
+
),
|
|
714
|
+
item(
|
|
715
|
+
"K\xFCstenblatt",
|
|
716
|
+
"Hafen erweitert Containerterminal, um den G\xFCterverkehr zu verdoppeln",
|
|
717
|
+
"Das Projekt bringt sechs Kr\xE4ne und 40 Hektar neues Land am Meer.",
|
|
718
|
+
"harbour",
|
|
719
|
+
25,
|
|
720
|
+
now,
|
|
721
|
+
"hafen-2"
|
|
722
|
+
),
|
|
723
|
+
item(
|
|
724
|
+
"Nachrichten 24",
|
|
725
|
+
"Containerterminal im Hafen w\xE4chst: G\xFCterverkehr soll sich verdoppeln",
|
|
726
|
+
"Reedereien begr\xFC\xDFen die Entscheidung; Anwohner fordern ein L\xE4rmgutachten.",
|
|
727
|
+
"harbour",
|
|
728
|
+
41,
|
|
729
|
+
now,
|
|
730
|
+
"hafen-3"
|
|
731
|
+
),
|
|
732
|
+
item(
|
|
733
|
+
"Nachrichten 24",
|
|
734
|
+
"U-Bahn f\xE4hrt an den Feiertagen zum Jahreswechsel die ganze Nacht",
|
|
735
|
+
"Die Hauptlinien fahren vom 24. Dezember bis 6. Januar durchgehend, ab 1 Uhr alle f\xFCnfzehn Minuten.",
|
|
736
|
+
"city",
|
|
737
|
+
48,
|
|
738
|
+
now,
|
|
739
|
+
"u-bahn"
|
|
740
|
+
),
|
|
741
|
+
item(
|
|
742
|
+
"Die Chronik",
|
|
743
|
+
"Windpark auf der Hochebene liefert Strom: erste Ausbaustufe versorgt 90.000 Haushalte",
|
|
744
|
+
"Die 32 bisher errichteten Windr\xE4der speisen seit dieser Woche ins Netz ein; die zweite Ausbaustufe wird im Januar ausgeschrieben.",
|
|
745
|
+
"field",
|
|
746
|
+
95,
|
|
747
|
+
now,
|
|
748
|
+
"windpark-1"
|
|
749
|
+
),
|
|
750
|
+
item(
|
|
751
|
+
"K\xFCstenblatt",
|
|
752
|
+
"Windpark auf der Hochebene startet mit Versp\xE4tung: erste Ausbaustufe versorgt 90.000 Haushalte erst im Winter",
|
|
753
|
+
"Die Betreiber begr\xFCnden die Verz\xF6gerung mit fehlenden Transformatoren.",
|
|
754
|
+
"field",
|
|
755
|
+
130,
|
|
756
|
+
now,
|
|
757
|
+
"windpark-2"
|
|
758
|
+
),
|
|
759
|
+
item(
|
|
760
|
+
"Technik Heute KI",
|
|
761
|
+
"Offenes Sprachmodell zieht beim Programmieren mit den Gro\xDFen gleich",
|
|
762
|
+
"Das Team ver\xF6ffentlicht Gewichte und Testdaten; in unabh\xE4ngigen Tests l\xF6st es 71 % der Aufgaben, nah an kommerziellen Systemen.",
|
|
763
|
+
"city",
|
|
764
|
+
180,
|
|
765
|
+
now,
|
|
766
|
+
"offenes-modell"
|
|
767
|
+
)
|
|
768
|
+
];
|
|
769
|
+
var DECKS = { en: EN, es: ES, "zh-Hant": ZH_HANT, "zh-Hans": ZH_HANS, de: DE };
|
|
770
|
+
function demoDeck(now, locale = "en") {
|
|
771
|
+
const items = DECKS[pickLocale(Object.keys(DECKS), locale) ?? "en"](now);
|
|
298
772
|
const stories = clusterStories(items).sort((a, b) => b.consensus - a.consensus || b.lead.published - a.lead.published);
|
|
299
773
|
return { stories, updated: now - 3 * MIN, failed: [] };
|
|
300
774
|
}
|
|
301
|
-
function demoCornerWeather(now) {
|
|
775
|
+
function demoCornerWeather(now, locale = "en") {
|
|
776
|
+
const city2 = localize({ en: "madrid", es: "madrid", de: "madrid", "zh-Hant": "taipei", "zh-Hans": "shanghai" }, locale);
|
|
777
|
+
const warmer = city2 === "taipei" ? 7 : 0;
|
|
778
|
+
const place = city2 === "taipei" ? { en: "Taipei", es: "Taip\xE9i", de: "Taipeh", "zh-Hant": "\u81FA\u5317", "zh-Hans": "\u53F0\u5317" } : city2 === "shanghai" ? { en: "Shanghai", es: "Shangh\xE1i", de: "Shanghai", "zh-Hant": "\u4E0A\u6D77", "zh-Hans": "\u4E0A\u6D77" } : { en: "Madrid", es: "Madrid", de: "Madrid", "zh-Hant": "\u99AC\u5FB7\u91CC", "zh-Hans": "\u9A6C\u5FB7\u91CC" };
|
|
302
779
|
return {
|
|
303
|
-
place:
|
|
304
|
-
temp: 14,
|
|
305
|
-
feels: 12,
|
|
780
|
+
place: localize(place, locale),
|
|
781
|
+
temp: 14 + warmer,
|
|
782
|
+
feels: 12 + warmer,
|
|
306
783
|
code: 2,
|
|
307
784
|
humidity: 60,
|
|
308
785
|
wind: 10,
|
|
309
786
|
night: false,
|
|
310
|
-
days: [{ date: new Date(now).toISOString().slice(0, 10), code: 2, min: 6, max: 16, rain: 10 }],
|
|
787
|
+
days: [{ date: new Date(now).toISOString().slice(0, 10), code: 2, min: 6 + warmer, max: 16 + warmer, rain: 10 }],
|
|
311
788
|
hours: [],
|
|
312
789
|
fetched: now - 5 * MIN
|
|
313
790
|
};
|
|
@@ -548,13 +1025,16 @@ async function fetchAllFeeds(feeds, o) {
|
|
|
548
1025
|
});
|
|
549
1026
|
return { items: dedupe(all), failed, frozen };
|
|
550
1027
|
}
|
|
1028
|
+
function headlineKey(title) {
|
|
1029
|
+
return isCjk(title) ? compactTitle(title) : titleTerms(title).slice(0, 6).join(" ");
|
|
1030
|
+
}
|
|
551
1031
|
function dedupe(items) {
|
|
552
1032
|
const seenLink = /* @__PURE__ */ new Set();
|
|
553
1033
|
const seenTitle = /* @__PURE__ */ new Set();
|
|
554
1034
|
const out = [];
|
|
555
1035
|
for (const it of items) {
|
|
556
1036
|
const link = it.link.trim().toLowerCase();
|
|
557
|
-
const key = it.title
|
|
1037
|
+
const key = headlineKey(it.title);
|
|
558
1038
|
if (link && seenLink.has(link)) continue;
|
|
559
1039
|
if (key && seenTitle.has(key)) continue;
|
|
560
1040
|
if (link) seenLink.add(link);
|
|
@@ -711,8 +1191,14 @@ function storyAge(p, published) {
|
|
|
711
1191
|
if (!published || published > p.now) return null;
|
|
712
1192
|
return p.fmt.ago(published);
|
|
713
1193
|
}
|
|
714
|
-
function outletsLabel(n) {
|
|
715
|
-
return
|
|
1194
|
+
function outletsLabel(p, n) {
|
|
1195
|
+
return p.plural(n, {
|
|
1196
|
+
en: { one: "{n} outlet", other: "{n} outlets" },
|
|
1197
|
+
es: { one: "{n} cabecera", other: "{n} cabeceras" },
|
|
1198
|
+
"zh-Hant": { other: "{n} \u5BB6\u5A92\u9AD4" },
|
|
1199
|
+
"zh-Hans": { other: "{n} \u5BB6\u5A92\u4F53" },
|
|
1200
|
+
de: { one: "{n} Medium", other: "{n} Medien" }
|
|
1201
|
+
});
|
|
716
1202
|
}
|
|
717
1203
|
function coverRect(iw, ih, w, h, bias = 0.35) {
|
|
718
1204
|
const scale = Math.max(w / iw, h / ih);
|
|
@@ -785,7 +1271,7 @@ function kicker(p, x, y, maxW, size, source, extra) {
|
|
|
785
1271
|
}
|
|
786
1272
|
function extras(p, item2, consensus) {
|
|
787
1273
|
const age = storyAge(p, item2.published);
|
|
788
|
-
return [...age ? [age] : [], ...consensus > 1 ? [
|
|
1274
|
+
return [...age ? [age] : [], ...consensus > 1 ? [outletsLabel(p, consensus)] : []];
|
|
789
1275
|
}
|
|
790
1276
|
function corner(p, right, bottom, k, weather) {
|
|
791
1277
|
const { g, kit, fonts } = p;
|
|
@@ -871,7 +1357,7 @@ function drawContrast(p, b, pair, story, k) {
|
|
|
871
1357
|
const top = b.y + Math.max(PAD, Math.round((b.h - groupH) / 2));
|
|
872
1358
|
const kickerY = top + kickerCap;
|
|
873
1359
|
const age = storyAge(p, story.lead.published);
|
|
874
|
-
kicker(p, b.x + PAD, kickerY, b.w - 2 * PAD, 23 * k,
|
|
1360
|
+
kicker(p, b.x + PAD, kickerY, b.w - 2 * PAD, 23 * k, outletsLabel(p, story.consensus), age ? [age] : []);
|
|
875
1361
|
const ruleX = b.x + PAD + colW + GUTTER / 2;
|
|
876
1362
|
const ruleTop = kickerY + kickerGap - 8 * k;
|
|
877
1363
|
const ruleH = sourceGap + tallest + 8 * k;
|
|
@@ -924,7 +1410,7 @@ function drawWaiting(p, b) {
|
|
|
924
1410
|
const { g, kit, fonts } = p;
|
|
925
1411
|
drawPhoto(g, null, null, b);
|
|
926
1412
|
const size = clamp(b.h / 12, 11, 30);
|
|
927
|
-
const text = p.t({ en: "Waiting for the news\u2026", es: "Esperando las noticias\u2026" });
|
|
1413
|
+
const text = p.t({ en: "Waiting for the news\u2026", es: "Esperando las noticias\u2026", "zh-Hant": "\u6B63\u5728\u7B49\u5019\u65B0\u805E\u2026", "zh-Hans": "\u6B63\u5728\u7B49\u5F85\u65B0\u95FB\u2026", de: "Warte auf Nachrichten\u2026" });
|
|
928
1414
|
kit.drawTracked(g, kit.truncate(g, text, b.w * 0.9, { size, family: fonts.sans }), b.x + b.w / 2, b.y + b.h / 2 + size * 0.35, { size, family: fonts.sans, color: PALETTE.INK_DIM, align: "center" });
|
|
929
1415
|
}
|
|
930
1416
|
|
|
@@ -1054,28 +1540,39 @@ var cacheOf = (ctx) => ctx.cacheDir || ctx.dataDir;
|
|
|
1054
1540
|
var imageDir = (ctx) => join2(cacheOf(ctx), "images");
|
|
1055
1541
|
var PHOTO_TRIES = 4;
|
|
1056
1542
|
var feedItem = t.object({
|
|
1057
|
-
name: t.string({ label: { en: "Name", es: "Nombre" }, placeholder: "El Pa\xEDs", help: { en: 'Shown on screen. Ending in " IA" marks a topic feed of the same outlet.', es: "Sale en pantalla. Acabar en \xAB IA\xBB marca un feed tem\xE1tico de la misma cabecera." } }),
|
|
1058
|
-
url: t.string({ format: "url", risk: "network", label: { en: "RSS URL", es: "URL del RSS" } }),
|
|
1059
|
-
titleFilter: t.string({ advanced: true, label: { en: "Headline filter (regex)", es: "Filtro de titular (regex)" }, help: { en: "Only headlines matching it stay.", es: "S\xF3lo quedan los titulares que casan." } }),
|
|
1060
|
-
maxAgeMs: t.duration({ default: 0, max: 30 * 24 * 36e5, advanced: true, label: { en: "Maximum age", es: "Antig\xFCedad m\xE1xima" }, help: { en: "0: the general one.", es: "0: la general." } })
|
|
1543
|
+
name: t.string({ label: { en: "Name", es: "Nombre", "zh-Hant": "\u540D\u7A31", "zh-Hans": "\u540D\u79F0", de: "Name" }, placeholder: "El Pa\xEDs", help: { en: 'Shown on screen. Ending in " IA" marks a topic feed of the same outlet.', es: "Sale en pantalla. Acabar en \xAB IA\xBB marca un feed tem\xE1tico de la misma cabecera.", "zh-Hant": "\u986F\u793A\u5728\u87A2\u5E55\u4E0A\u3002\u4EE5\u300C IA\u300D\u7D50\u5C3E\u8868\u793A\u540C\u4E00\u5BB6\u5A92\u9AD4\u7684\u4E3B\u984C\u8A02\u95B1\u6E90\u3002", "zh-Hans": "\u663E\u793A\u5728\u5C4F\u5E55\u4E0A\u3002\u4EE5\u201C IA\u201D\u7ED3\u5C3E\u8868\u793A\u540C\u4E00\u5BB6\u5A92\u4F53\u7684\u4E3B\u9898\u8BA2\u9605\u6E90\u3002", de: "Wird auf dem Bildschirm angezeigt. Endet der Name auf \u201E KI\u201C (oder \u201E IA\u201C, \u201E AI\u201C), ist es ein Themen-Feed desselben Mediums." } }),
|
|
1544
|
+
url: t.string({ format: "url", risk: "network", label: { en: "RSS URL", es: "URL del RSS", "zh-Hant": "RSS \u7DB2\u5740", "zh-Hans": "RSS \u7F51\u5740", de: "RSS-URL" } }),
|
|
1545
|
+
titleFilter: t.string({ advanced: true, label: { en: "Headline filter (regex)", es: "Filtro de titular (regex)", "zh-Hant": "\u6A19\u984C\u7BE9\u9078\uFF08\u6B63\u898F\u8868\u793A\u5F0F\uFF09", "zh-Hans": "\u6807\u9898\u8FC7\u6EE4\uFF08\u6B63\u5219\uFF09", de: "Schlagzeilenfilter (Regex)" }, help: { en: "Only headlines matching it stay.", es: "S\xF3lo quedan los titulares que casan.", "zh-Hant": "\u53EA\u4FDD\u7559\u7B26\u5408\u7684\u6A19\u984C\u3002", "zh-Hans": "\u53EA\u4FDD\u7559\u5339\u914D\u7684\u6807\u9898\u3002", de: "Nur passende Schlagzeilen bleiben." } }),
|
|
1546
|
+
maxAgeMs: t.duration({ default: 0, max: 30 * 24 * 36e5, advanced: true, label: { en: "Maximum age", es: "Antig\xFCedad m\xE1xima", "zh-Hant": "\u6700\u9577\u6642\u6548", "zh-Hans": "\u6700\u957F\u65F6\u6548", de: "Maximales Alter" }, help: { en: "0: the general one.", es: "0: la general.", "zh-Hant": "0\uFF1A\u4F7F\u7528\u6574\u9AD4\u8A2D\u5B9A\u3002", "zh-Hans": "0\uFF1A\u4F7F\u7528\u603B\u4F53\u8BBE\u7F6E\u3002", de: "0: der allgemeine Wert." } })
|
|
1061
1547
|
});
|
|
1062
1548
|
var deck = defineSource({
|
|
1063
1549
|
id: "deck",
|
|
1064
|
-
name: { en: "News deck", es: "Mazo de noticias" },
|
|
1550
|
+
name: { en: "News deck", es: "Mazo de noticias", "zh-Hant": "\u65B0\u805E\u724C\u7D44", "zh-Hans": "\u65B0\u95FB\u5361\u7EC4", de: "Nachrichtenstapel" },
|
|
1065
1551
|
description: {
|
|
1066
1552
|
en: "Reads the RSS feeds, drops junk and stale items, groups the same story across outlets and orders what to show.",
|
|
1067
|
-
es: "Lee los RSS, quita relleno y noticias viejas, agrupa la misma historia de varias cabeceras y ordena qu\xE9 ense\xF1ar."
|
|
1553
|
+
es: "Lee los RSS, quita relleno y noticias viejas, agrupa la misma historia de varias cabeceras y ordena qu\xE9 ense\xF1ar.",
|
|
1554
|
+
"zh-Hant": "\u8B80\u53D6 RSS \u8A02\u95B1\u6E90\uFF0C\u5254\u9664\u7121\u7528\u548C\u904E\u6642\u7684\u9805\u76EE\uFF0C\u628A\u5404\u5BB6\u5A92\u9AD4\u7684\u540C\u4E00\u5247\u65B0\u805E\u6B78\u6210\u4E00\u7D44\uFF0C\u4E26\u6392\u5B9A\u986F\u793A\u9806\u5E8F\u3002",
|
|
1555
|
+
"zh-Hans": "\u8BFB\u53D6 RSS \u8BA2\u9605\u6E90\uFF0C\u5254\u9664\u65E0\u7528\u548C\u8FC7\u65F6\u7684\u6761\u76EE\uFF0C\u628A\u5404\u5BB6\u5A92\u4F53\u7684\u540C\u4E00\u6761\u65B0\u95FB\u5F52\u4E3A\u4E00\u7EC4\uFF0C\u5E76\u6392\u5B9A\u663E\u793A\u987A\u5E8F\u3002",
|
|
1556
|
+
de: "Liest die RSS-Feeds, verwirft F\xFCllstoff und veraltete Meldungen, fasst dieselbe Geschichte verschiedener Medien zusammen und legt fest, was gezeigt wird."
|
|
1068
1557
|
},
|
|
1069
1558
|
options: t.object({
|
|
1070
1559
|
feeds: t.list(feedItem, {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1560
|
+
// Empty, not a list: the outlets depend on the user's language, which a
|
|
1561
|
+
// static default can't know. `read` fills them in (`defaultFeeds`).
|
|
1562
|
+
default: [],
|
|
1563
|
+
label: { en: "Feeds", es: "Fuentes", "zh-Hant": "\u8A02\u95B1\u6E90", "zh-Hans": "\u8BA2\u9605\u6E90", de: "Feeds" },
|
|
1564
|
+
help: {
|
|
1565
|
+
en: "Empty: well-known outlets in your language. Order matters: a repeated story keeps the label of the first feed.",
|
|
1566
|
+
es: "Vac\xEDo: cabeceras conocidas en tu idioma. El orden importa: una noticia repetida se queda con la etiqueta de la primera fuente.",
|
|
1567
|
+
"zh-Hant": "\u7559\u7A7A\uFF1A\u4F7F\u7528\u4F60\u7684\u8A9E\u8A00\u7684\u77E5\u540D\u5A92\u9AD4\u3002\u9806\u5E8F\u5F88\u91CD\u8981\uFF1A\u91CD\u8907\u7684\u65B0\u805E\u6703\u6CBF\u7528\u7B2C\u4E00\u500B\u8A02\u95B1\u6E90\u7684\u6A19\u7C64\u3002",
|
|
1568
|
+
"zh-Hans": "\u7559\u7A7A\uFF1A\u4F7F\u7528\u4F60\u7684\u8BED\u8A00\u7684\u77E5\u540D\u5A92\u4F53\u3002\u987A\u5E8F\u5F88\u91CD\u8981\uFF1A\u91CD\u590D\u7684\u65B0\u95FB\u4F1A\u6CBF\u7528\u7B2C\u4E00\u4E2A\u8BA2\u9605\u6E90\u7684\u6807\u7B7E\u3002",
|
|
1569
|
+
de: "Leer: bekannte Medien in deiner Sprache. Die Reihenfolge z\xE4hlt: Eine doppelte Meldung beh\xE4lt die Bezeichnung des ersten Feeds."
|
|
1570
|
+
}
|
|
1074
1571
|
}),
|
|
1075
|
-
topic: t.enum(["all", "ai"], { label: { en: "Topic", es: "Tema" }, labels: { all: { en: "Everything", es: "Todo" }, ai: { en: "Only AI", es: "S\xF3lo IA" } } }),
|
|
1076
|
-
maxAgeMs: t.duration({ default: DEFAULT_MAX_AGE_MS, max: 30 * 24 * 36e5, label: { en: "Maximum age", es: "Antig\xFCedad m\xE1xima" }, help: { en: "0: no limit (undated items then pass too).", es: "0: sin l\xEDmite (pasan tambi\xE9n las que no traen fecha)." } }),
|
|
1077
|
-
rejectFilter: t.string({ default: JUNK_TITLE_FILTER, advanced: true, multiline: true, label: { en: "Discard headlines (regex)", es: "Descartar titulares (regex)" }, help: { en: "Case-insensitive. Empty: keep everything.", es: "Sin distinguir may\xFAsculas. Vac\xEDo: no se descarta nada." } }),
|
|
1078
|
-
maxStories: t.integer({ min: 5, max: 200, default: 60, advanced: true, label: { en: "Stories in the deck", es: "Historias en el mazo" } })
|
|
1572
|
+
topic: t.enum(["all", "ai"], { label: { en: "Topic", es: "Tema", "zh-Hant": "\u4E3B\u984C", "zh-Hans": "\u4E3B\u9898", de: "Thema" }, labels: { all: { en: "Everything", es: "Todo", "zh-Hant": "\u5168\u90E8", "zh-Hans": "\u5168\u90E8", de: "Alles" }, ai: { en: "Only AI", es: "S\xF3lo IA", "zh-Hant": "\u53EA\u770B AI", "zh-Hans": "\u53EA\u770B AI", de: "Nur KI" } } }),
|
|
1573
|
+
maxAgeMs: t.duration({ default: DEFAULT_MAX_AGE_MS, max: 30 * 24 * 36e5, label: { en: "Maximum age", es: "Antig\xFCedad m\xE1xima", "zh-Hant": "\u6700\u9577\u6642\u6548", "zh-Hans": "\u6700\u957F\u65F6\u6548", de: "Maximales Alter" }, help: { en: "0: no limit (undated items then pass too).", es: "0: sin l\xEDmite (pasan tambi\xE9n las que no traen fecha).", "zh-Hant": "0\uFF1A\u4E0D\u9650\uFF08\u6C92\u6709\u65E5\u671F\u7684\u9805\u76EE\u4E5F\u6703\u901A\u904E\uFF09\u3002", "zh-Hans": "0\uFF1A\u4E0D\u9650\uFF08\u6CA1\u6709\u65E5\u671F\u7684\u6761\u76EE\u4E5F\u4F1A\u901A\u8FC7\uFF09\u3002", de: "0: unbegrenzt (dann kommen auch Meldungen ohne Datum durch)." } }),
|
|
1574
|
+
rejectFilter: t.string({ default: JUNK_TITLE_FILTER, advanced: true, multiline: true, label: { en: "Discard headlines (regex)", es: "Descartar titulares (regex)", "zh-Hant": "\u6392\u9664\u6A19\u984C\uFF08\u6B63\u898F\u8868\u793A\u5F0F\uFF09", "zh-Hans": "\u6392\u9664\u6807\u9898\uFF08\u6B63\u5219\uFF09", de: "Schlagzeilen verwerfen (Regex)" }, help: { en: "Case-insensitive. Empty: keep everything.", es: "Sin distinguir may\xFAsculas. Vac\xEDo: no se descarta nada.", "zh-Hant": "\u4E0D\u5206\u5927\u5C0F\u5BEB\u3002\u7559\u7A7A\uFF1A\u5168\u90E8\u4FDD\u7559\u3002", "zh-Hans": "\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u3002\u7559\u7A7A\uFF1A\u5168\u90E8\u4FDD\u7559\u3002", de: "Gro\xDF-/Kleinschreibung egal. Leer: nichts wird verworfen." } }),
|
|
1575
|
+
maxStories: t.integer({ min: 5, max: 200, default: 60, advanced: true, label: { en: "Stories in the deck", es: "Historias en el mazo", "zh-Hant": "\u724C\u7D44\u4E2D\u7684\u65B0\u805E\u6578", "zh-Hans": "\u5361\u7EC4\u4E2D\u7684\u65B0\u95FB\u6570", de: "Meldungen im Stapel" } })
|
|
1079
1576
|
}),
|
|
1080
1577
|
intervalMs: 10 * 6e4,
|
|
1081
1578
|
// A dozen outlets per read: more often than every two minutes is only noise for them.
|
|
@@ -1084,12 +1581,14 @@ var deck = defineSource({
|
|
|
1084
1581
|
timeoutMs: 25e3,
|
|
1085
1582
|
async read(ctx) {
|
|
1086
1583
|
const o = ctx.options;
|
|
1087
|
-
const
|
|
1088
|
-
const
|
|
1584
|
+
const ai2 = o.topic === "ai";
|
|
1585
|
+
const chosen = o.feeds.filter((f) => f.url.trim());
|
|
1586
|
+
const own = chosen.length ? chosen : defaultFeeds(ctx.pickLanguage(Object.keys(DEFAULT_FEEDS_BY_LANGUAGE))).map((f) => ({ name: f.name, url: f.url, titleFilter: f.titleFilter ?? "", maxAgeMs: f.maxAgeMs ?? 0 }));
|
|
1587
|
+
const feeds = own.map((f) => ({
|
|
1089
1588
|
name: f.name.trim() || new URL(f.url).hostname,
|
|
1090
1589
|
url: f.url.trim(),
|
|
1091
|
-
titleFilter: (
|
|
1092
|
-
maxAgeMs: f.maxAgeMs || (
|
|
1590
|
+
titleFilter: (ai2 ? AI_TITLE_FILTER : f.titleFilter.trim()) || void 0,
|
|
1591
|
+
maxAgeMs: f.maxAgeMs || (ai2 ? AI_MAX_AGE_MS : void 0)
|
|
1093
1592
|
}));
|
|
1094
1593
|
const file = join2(cacheOf(ctx), DECK_FILE);
|
|
1095
1594
|
pruneImageCache(imageDir(ctx), IMAGE_MAX_AGE_HOURS, ctx.now);
|
|
@@ -1128,16 +1627,19 @@ function loadDeck(file, now) {
|
|
|
1128
1627
|
}
|
|
1129
1628
|
}
|
|
1130
1629
|
var shared = {
|
|
1131
|
-
rotateMs: t.duration({ min: 1e4, max: 36e5, default: 3e4, label: { en: "Each story for", es: "Cada noticia durante" } }),
|
|
1630
|
+
rotateMs: t.duration({ min: 1e4, max: 36e5, default: 3e4, label: { en: "Each story for", es: "Cada noticia durante", "zh-Hant": "\u6BCF\u5247\u65B0\u805E\u986F\u793A", "zh-Hans": "\u6BCF\u6761\u65B0\u95FB\u663E\u793A", de: "Jede Meldung f\xFCr" } }),
|
|
1132
1631
|
outlets: t.filter({
|
|
1133
1632
|
choices: { source: "news/deck", list: "outlets" },
|
|
1134
|
-
label: { en: "Outlets", es: "Cabeceras" },
|
|
1633
|
+
label: { en: "Outlets", es: "Cabeceras", "zh-Hant": "\u5A92\u9AD4", "zh-Hans": "\u5A92\u4F53", de: "Medien" },
|
|
1135
1634
|
help: {
|
|
1136
1635
|
en: "Empty: all. Feed names as in the news source (El Pa\xEDs, Xataka IA\u2026), comma-separated; * matches anything, a leading ! leaves out. A story carried by several shows the version of one of these.",
|
|
1137
|
-
es: "Vac\xEDo: todas. Nombres de fuente como en el mazo de noticias (El Pa\xEDs, Xataka IA\u2026), separados por comas; * vale por cualquier cosa y un ! delante excluye. De una historia de varias se ve la versi\xF3n de una de estas."
|
|
1636
|
+
es: "Vac\xEDo: todas. Nombres de fuente como en el mazo de noticias (El Pa\xEDs, Xataka IA\u2026), separados por comas; * vale por cualquier cosa y un ! delante excluye. De una historia de varias se ve la versi\xF3n de una de estas.",
|
|
1637
|
+
"zh-Hant": "\u7559\u7A7A\uFF1A\u5168\u90E8\u3002\u586B\u5165\u65B0\u805E\u4F86\u6E90\u4E2D\u7684\u8A02\u95B1\u6E90\u540D\u7A31\uFF08El Pa\xEDs\u3001Xataka IA\u2026\uFF09\uFF0C\u4EE5\u9017\u865F\u5206\u9694\uFF1B* \u53EF\u6BD4\u5C0D\u4EFB\u4F55\u5167\u5BB9\uFF0C\u958B\u982D\u52A0 ! \u8868\u793A\u6392\u9664\u3002\u591A\u5BB6\u5A92\u9AD4\u5831\u5C0E\u7684\u65B0\u805E\u6703\u986F\u793A\u5176\u4E2D\u4E00\u5BB6\u7684\u7248\u672C\u3002",
|
|
1638
|
+
"zh-Hans": "\u7559\u7A7A\uFF1A\u5168\u90E8\u3002\u586B\u5199\u65B0\u95FB\u6570\u636E\u6E90\u4E2D\u7684\u8BA2\u9605\u6E90\u540D\u79F0\uFF08El Pa\xEDs\u3001Xataka IA\u2026\uFF09\uFF0C\u7528\u9017\u53F7\u5206\u9694\uFF1B* \u5339\u914D\u4EFB\u610F\u5185\u5BB9\uFF0C\u5F00\u5934\u52A0 ! \u8868\u793A\u6392\u9664\u3002\u591A\u5BB6\u5A92\u4F53\u62A5\u9053\u7684\u65B0\u95FB\u4F1A\u663E\u793A\u5176\u4E2D\u4E00\u5BB6\u7684\u7248\u672C\u3002",
|
|
1639
|
+
de: "Leer: alle. Feed-Namen wie in der Nachrichten-Datenquelle (tagesschau, heise KI\u2026), durch Kommas getrennt; * steht f\xFCr beliebigen Text, ein vorangestelltes ! schlie\xDFt aus. Von einer Meldung mehrerer Medien wird die Fassung eines dieser Medien gezeigt."
|
|
1138
1640
|
}
|
|
1139
1641
|
}),
|
|
1140
|
-
showStandfirst: t.boolean({ default: true, label: { en: "Standfirst", es: "Entradilla" }, help: { en: "The summary under the headline. Off: the headline alone, with room for longer ones.", es: "El resumen bajo el titular. Apagado: el titular solo, con sitio para los largos." } })
|
|
1642
|
+
showStandfirst: t.boolean({ default: true, label: { en: "Standfirst", es: "Entradilla", "zh-Hant": "\u5C0E\u8A00", "zh-Hans": "\u5BFC\u8BED", de: "Vorspann" }, help: { en: "The summary under the headline. Off: the headline alone, with room for longer ones.", es: "El resumen bajo el titular. Apagado: el titular solo, con sitio para los largos.", "zh-Hant": "\u6A19\u984C\u4E0B\u65B9\u7684\u6458\u8981\u3002\u95DC\u9589\uFF1A\u53EA\u986F\u793A\u6A19\u984C\uFF0C\u53EF\u5BB9\u7D0D\u8F03\u9577\u7684\u6A19\u984C\u3002", "zh-Hans": "\u6807\u9898\u4E0B\u65B9\u7684\u6458\u8981\u3002\u5173\u95ED\uFF1A\u53EA\u663E\u793A\u6807\u9898\uFF0C\u53EF\u5BB9\u7EB3\u8F83\u957F\u7684\u6807\u9898\u3002", de: "Die Zusammenfassung unter der Schlagzeile. Aus: nur die Schlagzeile, mit Platz f\xFCr l\xE4ngere." } })
|
|
1141
1643
|
};
|
|
1142
1644
|
var DEMO_PHOTO = "demo:";
|
|
1143
1645
|
var deckOf = (sources) => sources["news/deck"];
|
|
@@ -1180,31 +1682,34 @@ function current(ctx) {
|
|
|
1180
1682
|
return { story: storyAt(stories, ctx.now, ctx.options.rotateMs, ctx.options.offset), photo: null };
|
|
1181
1683
|
}
|
|
1182
1684
|
function painter(ctx, g) {
|
|
1183
|
-
return { g, kit: ctx.kit, fonts: ctx.theme.fonts, t: ctx.t, fmt: ctx.fmt, now: ctx.now };
|
|
1685
|
+
return { g, kit: ctx.kit, fonts: ctx.theme.fonts, t: ctx.t, plural: ctx.plural, fmt: ctx.fmt, now: ctx.now };
|
|
1184
1686
|
}
|
|
1185
1687
|
var demoOf = (url) => url?.startsWith(DEMO_PHOTO) ? url.slice(DEMO_PHOTO.length) : null;
|
|
1186
|
-
function demoShot(o, now, locale = "
|
|
1688
|
+
function demoShot(o, now, locale = "en") {
|
|
1187
1689
|
const d = demoDeck(now, locale);
|
|
1188
1690
|
const s = storyAt(storiesFor(d.stories, o.outlets ?? []), now, o.rotateMs, o.offset) ?? d.stories[0];
|
|
1189
|
-
return { data: { link: s.lead.link, photo: s.lead.image }, sources: { "news/deck": d, "weather/current": demoCornerWeather(now) } };
|
|
1691
|
+
return { data: { link: s.lead.link, photo: s.lead.image }, sources: { "news/deck": d, "weather/current": demoCornerWeather(now, locale) } };
|
|
1190
1692
|
}
|
|
1191
1693
|
var headline = defineWidget({
|
|
1192
1694
|
id: "headline",
|
|
1193
|
-
name: { en: "Headline", es: "Titular" },
|
|
1695
|
+
name: { en: "Headline", es: "Titular", "zh-Hant": "\u982D\u689D", "zh-Hans": "\u5934\u6761", de: "Schlagzeile" },
|
|
1194
1696
|
description: {
|
|
1195
1697
|
en: "One story at a time over its photo, full-bleed: outlet, age, how many outlets carry it, headline and standfirst. With two versions of the same fact side by side when outlets tell it differently.",
|
|
1196
|
-
es: "Una noticia cada vez sobre su foto a sangre: cabecera, antig\xFCedad, cu\xE1ntas cabeceras la llevan, titular y entradilla. Con dos versiones del mismo hecho lado a lado cuando las cabeceras lo cuentan distinto."
|
|
1698
|
+
es: "Una noticia cada vez sobre su foto a sangre: cabecera, antig\xFCedad, cu\xE1ntas cabeceras la llevan, titular y entradilla. Con dos versiones del mismo hecho lado a lado cuando las cabeceras lo cuentan distinto.",
|
|
1699
|
+
"zh-Hant": "\u4E00\u6B21\u4E00\u5247\u65B0\u805E\uFF0C\u6EFF\u7248\u758A\u5728\u7167\u7247\u4E0A\uFF1A\u5A92\u9AD4\u3001\u6642\u9593\u3001\u5E7E\u5BB6\u5A92\u9AD4\u5831\u5C0E\u3001\u6A19\u984C\u8207\u5C0E\u8A00\u3002\u5404\u5BB6\u5A92\u9AD4\u8AAA\u6CD5\u4E0D\u540C\u6642\uFF0C\u6703\u4E26\u6392\u986F\u793A\u540C\u4E00\u4EF6\u4E8B\u7684\u5169\u500B\u7248\u672C\u3002",
|
|
1700
|
+
"zh-Hans": "\u4E00\u6B21\u4E00\u6761\u65B0\u95FB\uFF0C\u6EE1\u7248\u53E0\u52A0\u5728\u7167\u7247\u4E0A\uFF1A\u5A92\u4F53\u3001\u65F6\u95F4\u3001\u51E0\u5BB6\u5A92\u4F53\u62A5\u9053\u3001\u6807\u9898\u548C\u5BFC\u8BED\u3002\u5404\u5BB6\u5A92\u4F53\u8BF4\u6CD5\u4E0D\u540C\u65F6\uFF0C\u4F1A\u5E76\u6392\u663E\u793A\u540C\u4E00\u4EF6\u4E8B\u7684\u4E24\u4E2A\u7248\u672C\u3002",
|
|
1701
|
+
de: "Eine Meldung nach der anderen, randlos \xFCber ihrem Foto: Medium, Alter, wie viele Medien sie bringen, Schlagzeile und Vorspann. Erz\xE4hlen die Medien dasselbe unterschiedlich, stehen zwei Fassungen nebeneinander."
|
|
1197
1702
|
},
|
|
1198
1703
|
icon: "newspaper",
|
|
1199
1704
|
category: "info",
|
|
1200
|
-
tags: ["news", "noticias", "rss", "press", "prensa"],
|
|
1705
|
+
tags: ["news", "noticias", "rss", "press", "prensa", "nachrichten", "presse"],
|
|
1201
1706
|
chrome: "bare",
|
|
1202
1707
|
size: { min: { w: 480, h: 200 }, preferred: { w: 1920, h: 462 } },
|
|
1203
1708
|
options: t.object({
|
|
1204
1709
|
...shared,
|
|
1205
|
-
offset: t.integer({ min: 0, max: 50, default: 0, advanced: true, label: { en: "Skip stories", es: "Saltar noticias" }, help: { en: "So two news widgets on one screen don't show the same story.", es: "Para que dos widgets de noticias en una pantalla no ense\xF1en la misma." } }),
|
|
1206
|
-
showContrast: t.boolean({ default: true, label: { en: "Two versions side by side", es: "Dos versiones lado a lado" }, help: { en: "On wide tiles, when two outlets tell the same fact differently.", es: "En teselas anchas, cuando dos cabeceras cuentan el mismo hecho de forma distinta." } }),
|
|
1207
|
-
showCorner: t.boolean({ default: true, label: { en: "Clock and weather", es: "Reloj y tiempo" } })
|
|
1710
|
+
offset: t.integer({ min: 0, max: 50, default: 0, advanced: true, label: { en: "Skip stories", es: "Saltar noticias", "zh-Hant": "\u7565\u904E\u65B0\u805E", "zh-Hans": "\u8DF3\u8FC7\u65B0\u95FB", de: "Meldungen \xFCberspringen" }, help: { en: "So two news widgets on one screen don't show the same story.", es: "Para que dos widgets de noticias en una pantalla no ense\xF1en la misma.", "zh-Hant": "\u8B93\u540C\u4E00\u87A2\u5E55\u4E0A\u7684\u5169\u500B\u65B0\u805E\u5C0F\u5DE5\u5177\u4E0D\u6703\u986F\u793A\u540C\u4E00\u5247\u65B0\u805E\u3002", "zh-Hans": "\u8BA9\u540C\u4E00\u5C4F\u5E55\u4E0A\u7684\u4E24\u4E2A\u65B0\u95FB\u5C0F\u7EC4\u4EF6\u4E0D\u4F1A\u663E\u793A\u540C\u4E00\u6761\u65B0\u95FB\u3002", de: "Damit zwei Nachrichten-Widgets auf einem Bildschirm nicht dieselbe Meldung zeigen." } }),
|
|
1711
|
+
showContrast: t.boolean({ default: true, label: { en: "Two versions side by side", es: "Dos versiones lado a lado", "zh-Hant": "\u5169\u500B\u7248\u672C\u4E26\u6392", "zh-Hans": "\u4E24\u4E2A\u7248\u672C\u5E76\u6392", de: "Zwei Fassungen nebeneinander" }, help: { en: "On wide tiles, when two outlets tell the same fact differently.", es: "En teselas anchas, cuando dos cabeceras cuentan el mismo hecho de forma distinta.", "zh-Hant": "\u7528\u65BC\u5BEC\u65B9\u683C\uFF0C\u7576\u5169\u5BB6\u5A92\u9AD4\u5C0D\u540C\u4E00\u4EF6\u4E8B\u8AAA\u6CD5\u4E0D\u540C\u6642\u3002", "zh-Hans": "\u7528\u4E8E\u5BBD\u683C\u5B50\uFF0C\u5F53\u4E24\u5BB6\u5A92\u4F53\u5BF9\u540C\u4E00\u4EF6\u4E8B\u8BF4\u6CD5\u4E0D\u540C\u65F6\u3002", de: "Auf breiten Kacheln, wenn zwei Medien dasselbe unterschiedlich erz\xE4hlen." } }),
|
|
1712
|
+
showCorner: t.boolean({ default: true, label: { en: "Clock and weather", es: "Reloj y tiempo", "zh-Hant": "\u6642\u9418\u8207\u5929\u6C23", "zh-Hans": "\u65F6\u949F\u548C\u5929\u6C14", de: "Uhr und Wetter" } })
|
|
1208
1713
|
}),
|
|
1209
1714
|
sources: ["news/deck", "weather/current"],
|
|
1210
1715
|
fetch: pickShot,
|
|
@@ -1223,20 +1728,23 @@ var headline = defineWidget({
|
|
|
1223
1728
|
});
|
|
1224
1729
|
var column = defineWidget({
|
|
1225
1730
|
id: "column",
|
|
1226
|
-
name: { en: "News column", es: "Columna de noticias" },
|
|
1731
|
+
name: { en: "News column", es: "Columna de noticias", "zh-Hant": "\u65B0\u805E\u76F4\u6B04", "zh-Hans": "\u65B0\u95FB\u7AD6\u680F", de: "Nachrichtenspalte" },
|
|
1227
1732
|
description: {
|
|
1228
1733
|
en: "The current story in a column for a shared screen: photo with rounded corners, clock and temperature on top, headline and standfirst below.",
|
|
1229
|
-
es: "La noticia del momento en una columna para una pantalla compartida: foto con esquinas redondeadas, reloj y temperatura arriba, titular y entradilla abajo."
|
|
1734
|
+
es: "La noticia del momento en una columna para una pantalla compartida: foto con esquinas redondeadas, reloj y temperatura arriba, titular y entradilla abajo.",
|
|
1735
|
+
"zh-Hant": "\u5728\u5171\u7528\u87A2\u5E55\u4E0A\u4EE5\u76F4\u6B04\u986F\u793A\u76EE\u524D\u7684\u65B0\u805E\uFF1A\u5713\u89D2\u7167\u7247\uFF0C\u4E0A\u65B9\u662F\u6642\u9418\u8207\u6EAB\u5EA6\uFF0C\u4E0B\u65B9\u662F\u6A19\u984C\u8207\u5C0E\u8A00\u3002",
|
|
1736
|
+
"zh-Hans": "\u5728\u5171\u4EAB\u5C4F\u5E55\u4E0A\u4EE5\u7AD6\u680F\u663E\u793A\u5F53\u524D\u65B0\u95FB\uFF1A\u5706\u89D2\u7167\u7247\uFF0C\u4E0A\u65B9\u662F\u65F6\u949F\u548C\u6E29\u5EA6\uFF0C\u4E0B\u65B9\u662F\u6807\u9898\u548C\u5BFC\u8BED\u3002",
|
|
1737
|
+
de: "Die aktuelle Meldung als Spalte f\xFCr einen geteilten Bildschirm: Foto mit runden Ecken, oben Uhr und Temperatur, unten Schlagzeile und Vorspann."
|
|
1230
1738
|
},
|
|
1231
1739
|
icon: "newspaper",
|
|
1232
1740
|
category: "info",
|
|
1233
|
-
tags: ["news", "noticias", "rss"],
|
|
1741
|
+
tags: ["news", "noticias", "rss", "nachrichten"],
|
|
1234
1742
|
chrome: "bare",
|
|
1235
1743
|
size: { min: { w: 240, h: 240 }, preferred: { w: 600, h: 462 } },
|
|
1236
1744
|
options: t.object({
|
|
1237
1745
|
...shared,
|
|
1238
|
-
offset: t.integer({ min: 0, max: 50, default: 1, advanced: true, label: { en: "Skip stories", es: "Saltar noticias" }, help: { en: "So it doesn't repeat the story of a headline widget on the same screen.", es: "Para no repetir la noticia de un titular en la misma pantalla." } }),
|
|
1239
|
-
showCorner: t.boolean({ default: true, label: { en: "Clock and temperature", es: "Reloj y temperatura" } })
|
|
1746
|
+
offset: t.integer({ min: 0, max: 50, default: 1, advanced: true, label: { en: "Skip stories", es: "Saltar noticias", "zh-Hant": "\u7565\u904E\u65B0\u805E", "zh-Hans": "\u8DF3\u8FC7\u65B0\u95FB", de: "Meldungen \xFCberspringen" }, help: { en: "So it doesn't repeat the story of a headline widget on the same screen.", es: "Para no repetir la noticia de un titular en la misma pantalla.", "zh-Hant": "\u907F\u514D\u91CD\u8907\u540C\u4E00\u87A2\u5E55\u4E0A\u982D\u689D\u5C0F\u5DE5\u5177\u7684\u65B0\u805E\u3002", "zh-Hans": "\u907F\u514D\u91CD\u590D\u540C\u4E00\u5C4F\u5E55\u4E0A\u5934\u6761\u5C0F\u7EC4\u4EF6\u7684\u65B0\u95FB\u3002", de: "Damit es nicht die Meldung eines Schlagzeilen-Widgets auf demselben Bildschirm wiederholt." } }),
|
|
1747
|
+
showCorner: t.boolean({ default: true, label: { en: "Clock and temperature", es: "Reloj y temperatura", "zh-Hant": "\u6642\u9418\u8207\u6EAB\u5EA6", "zh-Hans": "\u65F6\u949F\u548C\u6E29\u5EA6", de: "Uhr und Temperatur" } })
|
|
1240
1748
|
}),
|
|
1241
1749
|
sources: ["news/deck", "weather/current"],
|
|
1242
1750
|
fetch: pickShot,
|
|
@@ -1254,14 +1762,18 @@ var column = defineWidget({
|
|
|
1254
1762
|
});
|
|
1255
1763
|
var index_default = definePlugin({
|
|
1256
1764
|
id: "news",
|
|
1257
|
-
name: { en: "News", es: "Noticias" },
|
|
1258
|
-
version: "0.2.
|
|
1765
|
+
name: { en: "News", es: "Noticias", "zh-Hant": "\u65B0\u805E", "zh-Hans": "\u65B0\u95FB", de: "Nachrichten" },
|
|
1766
|
+
version: "0.2.4",
|
|
1767
|
+
languages: ["en", "es", "zh-Hant", "zh-Hans", "de"],
|
|
1259
1768
|
sdk: "^0.2.0",
|
|
1260
1769
|
permissions: { network: ["user"] },
|
|
1261
1770
|
optional: ["weather/current"],
|
|
1262
1771
|
description: {
|
|
1263
1772
|
en: "Press headlines from RSS feeds with their photos. No keys and no AI: consensus across outlets measured with plain set overlap.",
|
|
1264
|
-
es: "Titulares de prensa de los RSS con su foto. Sin claves ni IA: el consenso entre cabeceras se mide con solapamiento de t\xE9rminos."
|
|
1773
|
+
es: "Titulares de prensa de los RSS con su foto. Sin claves ni IA: el consenso entre cabeceras se mide con solapamiento de t\xE9rminos.",
|
|
1774
|
+
"zh-Hant": "\u4F86\u81EA RSS \u8A02\u95B1\u6E90\u7684\u65B0\u805E\u6A19\u984C\u8207\u7167\u7247\u3002\u4E0D\u9700\u91D1\u9470\u4E5F\u4E0D\u7528 AI\uFF1A\u5404\u5BB6\u5A92\u9AD4\u9593\u7684\u5171\u8B58\u4EE5\u7C21\u55AE\u7684\u8A5E\u5F59\u91CD\u758A\u4F86\u8861\u91CF\u3002",
|
|
1775
|
+
"zh-Hans": "\u6765\u81EA RSS \u8BA2\u9605\u6E90\u7684\u65B0\u95FB\u6807\u9898\u548C\u7167\u7247\u3002\u65E0\u9700\u5BC6\u94A5\u4E5F\u4E0D\u7528 AI\uFF1A\u5404\u5BB6\u5A92\u4F53\u4E4B\u95F4\u7684\u5171\u8BC6\u7528\u7B80\u5355\u7684\u8BCD\u6C47\u91CD\u53E0\u6765\u8861\u91CF\u3002",
|
|
1776
|
+
de: "Schlagzeilen aus RSS-Feeds mit ihren Fotos. Ohne Schl\xFCssel und ohne KI: Der Konsens zwischen Medien wird \xFCber einfache Wort\xFCberschneidung gemessen."
|
|
1265
1777
|
},
|
|
1266
1778
|
author: "Kiosko",
|
|
1267
1779
|
license: "MIT",
|
|
@@ -1271,7 +1783,7 @@ var index_default = definePlugin({
|
|
|
1271
1783
|
templates: [
|
|
1272
1784
|
{
|
|
1273
1785
|
id: "news",
|
|
1274
|
-
name: { en: "News and weather", es: "Noticias y tiempo" },
|
|
1786
|
+
name: { en: "News and weather", es: "Noticias y tiempo", "zh-Hant": "\u65B0\u805E\u8207\u5929\u6C23", "zh-Hans": "\u65B0\u95FB\u548C\u5929\u6C14", de: "Nachrichten und Wetter" },
|
|
1275
1787
|
icon: "newspaper",
|
|
1276
1788
|
wide: [
|
|
1277
1789
|
{ x: 0, y: 0, w: 3 / 5, h: 1, widgets: ["headline"], chrome: "bare" },
|