├── .gitignore ├── Actions ├── Bilibili.taioactions ├── RSS.taioactions └── 微博热搜.json ├── Picture ├── favourite.png └── like.png └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .Trash 2 | desktop.ini 3 | Editor -------------------------------------------------------------------------------- /Actions/Bilibili.taioactions: -------------------------------------------------------------------------------- 1 | { 2 | "actions" : [ 3 | { 4 | "type" : "@comment", 5 | "parameters" : { 6 | "text" : { 7 | "value" : "rid变量值填写对应的榜单数字:\n0全站,1动画,3音乐,4游戏,5娱乐,17单机,36科技,119鬼畜,129舞蹈,138搞笑。\nkeywords变量值内填写关键词,中文逗号分隔即可。" 8 | } 9 | } 10 | }, 11 | { 12 | "type" : "@flow.set-variable", 13 | "parameters" : { 14 | "value" : { 15 | "value" : "0" 16 | }, 17 | "name" : { 18 | "value" : "rid" 19 | } 20 | } 21 | }, 22 | { 23 | "type" : "@flow.set-variable", 24 | "parameters" : { 25 | "value" : { 26 | "value" : "" 27 | }, 28 | "name" : { 29 | "value" : "keywords" 30 | } 31 | } 32 | }, 33 | { 34 | "type" : "@flow.get-variable", 35 | "parameters" : { 36 | "fallback" : 0, 37 | "name" : { 38 | "value" : "rid" 39 | } 40 | } 41 | }, 42 | { 43 | "type" : "@text", 44 | "parameters" : { 45 | "text" : { 46 | "value" : "https:\/\/app.bilibili.com\/x\/v2\/rank\/region?rid=$", 47 | "tokens" : [ 48 | { 49 | "location" : 46, 50 | "value" : "@input" 51 | } 52 | ] 53 | } 54 | } 55 | }, 56 | { 57 | "type" : "@util.request", 58 | "parameters" : { 59 | "body" : { 60 | "value" : "" 61 | }, 62 | "url" : { 63 | "value" : "$", 64 | "tokens" : [ 65 | { 66 | "location" : 0, 67 | "value" : "@input" 68 | } 69 | ] 70 | }, 71 | "method" : 0, 72 | "headers" : { 73 | "value" : "{\n \"Content-Type\": \"application\/json\"\n}" 74 | } 75 | } 76 | }, 77 | { 78 | "type" : "@flow.javascript", 79 | "parameters" : { 80 | "script" : { 81 | "value" : "const text = $actions.inputValue;\nconst keywords = $actions.getVar(\"keywords\");\nconst keyword = keywords.split(\",\");\n\nvar postresults = [];\nvar results = [];\n\nvar obj = JSON.parse(text);\nvar group = obj.data;\nvar num = group.length;\nfor (var i = 0; i < num; i++) {\n var item = group[i].title;\n var av = group[i].param;\n var name = group[i].name;\n var face = group[i].face;\n var play = group[i].play;\n if (play >= 10000) {\n var num1 = (play \/ 10000).toFixed(1);\n var playdetail = `${num1}万播放`;\n } else {\n playdetail = `${play}播放`;\n }\n var danmu = group[i].danmaku || 0;\n if (danmu >= 10000) {\n var num4 = (danmu \/ 10000).toFixed(1);\n var danmudetail = `${num4}万弹幕`;\n } else {\n danmudetail = `${danmu}弹幕`;\n }\n var like = group[i].like;\n if (like >= 10000) {\n var num2 = (like \/ 10000).toFixed(1);\n var likedetail = `${num2}万`;\n } else {\n likedetail = `${like}`;\n }\n var favourite = group[i].favourite;\n if (favourite >= 10000) {\n var num3 = (favourite \/ 10000).toFixed(1);\n var favouritedetail = `${num3}万`;\n } else {\n favouritedetail = `${favourite}`;\n }\n var reply = group[i].reply;\n if (reply >= 10000) {\n var num5 = (reply \/ 10000).toFixed(1);\n var replydetail = `${num5}万`;\n } else {\n replydetail = `${reply}`;\n }\n var time = group[i].pubdate;\n var date = new Date(time * 1000);\n var Y = date.getFullYear() + \"-\";\n var M =\n (date.getMonth() + 1 < 10\n ? \"0\" + (date.getMonth() + 1)\n : date.getMonth() + 1) + \"-\";\n var D = (date.getDate() < 10 ? \"0\" + date.getDate() : date.getDate()) + \" \";\n var h =\n (date.getHours() < 10 ? \"0\" + date.getHours() : date.getHours()) + \":\";\n var m =\n (date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes()) +\n \":\";\n var s = date.getSeconds() < 10 ? \"0\" + date.getSeconds() : date.getSeconds();\n var pubdate = Y + M + D + h + m + s;\n postresults.push({\n title: item,\n name: name,\n av: av,\n play: playdetail,\n like: likedetail,\n pubdate: pubdate,\n favourite: favouritedetail,\n danmu: danmudetail,\n reply: replydetail,\n face: face\n });\n}\n\nfor (var j = 0; j < keyword.length; j++) {\n getkeyword(\"Bilibili\", results, keyword[j], postresults);\n}\n\nfunction getkeyword(text, result, key, items) {\n for (var i = 0; i < items.length; i++) {\n if (items[i].title.indexOf(key) != -1) {\n results.push(items[i]);\n }\n }\n}\n\n$actions.resolve(JSON.stringify(results));" 82 | } 83 | } 84 | }, 85 | { 86 | "type" : "@flow.set-variable", 87 | "parameters" : { 88 | "value" : { 89 | "value" : "$", 90 | "tokens" : [ 91 | { 92 | "location" : 0, 93 | "value" : "@input" 94 | } 95 | ] 96 | }, 97 | "name" : { 98 | "value" : "results" 99 | } 100 | } 101 | }, 102 | { 103 | "type" : "@flow.get-variable", 104 | "parameters" : { 105 | "fallback" : 0, 106 | "name" : { 107 | "value" : "results" 108 | } 109 | } 110 | }, 111 | { 112 | "type" : "@flow.javascript", 113 | "parameters" : { 114 | "script" : { 115 | "value" : "const text = $actions.inputValue;\nvar obj = JSON.parse(text);\nvar names = \"\";\nfor (var i = 0; i < obj.length; i++) {\n if (i == obj.length - 1) {\n names += `${obj[i].title}`;\n } else {\n names += `${obj[i].title}\\n`;\n }\n}\n$actions.resolve(names);" 116 | } 117 | } 118 | }, 119 | { 120 | "type" : "@ui.menu", 121 | "parameters" : { 122 | "prompt" : { 123 | "value" : "" 124 | }, 125 | "multiValue" : false, 126 | "lines" : { 127 | "value" : "$", 128 | "tokens" : [ 129 | { 130 | "location" : 0, 131 | "value" : "@input" 132 | } 133 | ] 134 | } 135 | } 136 | }, 137 | { 138 | "type" : "@flow.set-variable", 139 | "parameters" : { 140 | "value" : { 141 | "value" : "$", 142 | "tokens" : [ 143 | { 144 | "location" : 0, 145 | "value" : "@input" 146 | } 147 | ] 148 | }, 149 | "name" : { 150 | "value" : "findthis" 151 | } 152 | } 153 | }, 154 | { 155 | "type" : "@flow.javascript", 156 | "parameters" : { 157 | "script" : { 158 | "value" : "const text = $actions.inputValue;\nconst res = $actions.getVar(\"results\");\nconst results = JSON.parse(res);\nfor (var i = 0; i < results.length; i++) {\n if (results[i].title == text) {\n var output = JSON.stringify(results[i]);\n $actions.resolve(output);\n }\n}" 159 | } 160 | } 161 | }, 162 | { 163 | "type" : "@flow.set-variable", 164 | "parameters" : { 165 | "value" : { 166 | "value" : "$", 167 | "tokens" : [ 168 | { 169 | "location" : 0, 170 | "value" : "@input" 171 | } 172 | ] 173 | }, 174 | "name" : { 175 | "value" : "showthis" 176 | } 177 | } 178 | }, 179 | { 180 | "type" : "@flow.javascript", 181 | "parameters" : { 182 | "script" : { 183 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar av = content.av;\n$actions.resolve(av);" 184 | } 185 | } 186 | }, 187 | { 188 | "type" : "@flow.set-variable", 189 | "parameters" : { 190 | "value" : { 191 | "value" : "$", 192 | "tokens" : [ 193 | { 194 | "location" : 0, 195 | "value" : "@input" 196 | } 197 | ] 198 | }, 199 | "name" : { 200 | "value" : "av" 201 | } 202 | } 203 | }, 204 | { 205 | "type" : "@flow.javascript", 206 | "parameters" : { 207 | "script" : { 208 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar like = content.like;\nvar favourite = content.favourite;\nvar reply = content.reply;\nvar detail = `${like} ${favourite} ${reply}`;\n$actions.resolve(detail);" 209 | } 210 | } 211 | }, 212 | { 213 | "type" : "@flow.set-variable", 214 | "parameters" : { 215 | "value" : { 216 | "value" : "$", 217 | "tokens" : [ 218 | { 219 | "location" : 0, 220 | "value" : "@input" 221 | } 222 | ] 223 | }, 224 | "name" : { 225 | "value" : "like" 226 | } 227 | } 228 | }, 229 | { 230 | "type" : "@flow.javascript", 231 | "parameters" : { 232 | "script" : { 233 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar play = content.play;\nvar danmu = content.danmu;\nvar data = `${play} ${danmu}`;\n$actions.resolve(data);" 234 | } 235 | } 236 | }, 237 | { 238 | "type" : "@flow.set-variable", 239 | "parameters" : { 240 | "value" : { 241 | "value" : "$", 242 | "tokens" : [ 243 | { 244 | "location" : 0, 245 | "value" : "@input" 246 | } 247 | ] 248 | }, 249 | "name" : { 250 | "value" : "data" 251 | } 252 | } 253 | }, 254 | { 255 | "type" : "@flow.javascript", 256 | "parameters" : { 257 | "script" : { 258 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar date = content.pubdate;\n$actions.resolve(date);" 259 | } 260 | } 261 | }, 262 | { 263 | "type" : "@flow.set-variable", 264 | "parameters" : { 265 | "value" : { 266 | "value" : "$", 267 | "tokens" : [ 268 | { 269 | "location" : 0, 270 | "value" : "@input" 271 | } 272 | ] 273 | }, 274 | "name" : { 275 | "value" : "pubdate" 276 | } 277 | } 278 | }, 279 | { 280 | "type" : "@flow.javascript", 281 | "parameters" : { 282 | "script" : { 283 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar face = content.face;\n$actions.resolve(face);" 284 | } 285 | } 286 | }, 287 | { 288 | "type" : "@flow.set-variable", 289 | "parameters" : { 290 | "value" : { 291 | "value" : "$", 292 | "tokens" : [ 293 | { 294 | "location" : 0, 295 | "value" : "@input" 296 | } 297 | ] 298 | }, 299 | "name" : { 300 | "value" : "face" 301 | } 302 | } 303 | }, 304 | { 305 | "type" : "@flow.javascript", 306 | "parameters" : { 307 | "script" : { 308 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar name = content.name;\n$actions.resolve(name);" 309 | } 310 | } 311 | }, 312 | { 313 | "type" : "@flow.set-variable", 314 | "parameters" : { 315 | "value" : { 316 | "value" : "$", 317 | "tokens" : [ 318 | { 319 | "location" : 0, 320 | "value" : "@input" 321 | } 322 | ] 323 | }, 324 | "name" : { 325 | "value" : "name" 326 | } 327 | } 328 | }, 329 | { 330 | "type" : "@flow.javascript", 331 | "parameters" : { 332 | "script" : { 333 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar like = content.like;\nvar like = `${like}`;\n$actions.resolve(like);" 334 | } 335 | } 336 | }, 337 | { 338 | "type" : "@flow.set-variable", 339 | "parameters" : { 340 | "value" : { 341 | "value" : "$", 342 | "tokens" : [ 343 | { 344 | "location" : 0, 345 | "value" : "@input" 346 | } 347 | ] 348 | }, 349 | "name" : { 350 | "value" : "like" 351 | } 352 | } 353 | }, 354 | { 355 | "type" : "@flow.javascript", 356 | "parameters" : { 357 | "script" : { 358 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar favourite = content.favourite;\nvar favourite = `${favourite}`;\n$actions.resolve(favourite);" 359 | } 360 | } 361 | }, 362 | { 363 | "type" : "@flow.set-variable", 364 | "parameters" : { 365 | "value" : { 366 | "value" : "$", 367 | "tokens" : [ 368 | { 369 | "location" : 0, 370 | "value" : "@input" 371 | } 372 | ] 373 | }, 374 | "name" : { 375 | "value" : "favourite" 376 | } 377 | } 378 | }, 379 | { 380 | "type" : "@flow.javascript", 381 | "parameters" : { 382 | "script" : { 383 | "value" : "const text = $actions.getVar(\"showthis\");\nvar content = JSON.parse(text);\nvar reply = content.reply;\nvar reply = `${reply}`;\n$actions.resolve(reply);" 384 | } 385 | } 386 | }, 387 | { 388 | "type" : "@flow.set-variable", 389 | "parameters" : { 390 | "value" : { 391 | "value" : "$", 392 | "tokens" : [ 393 | { 394 | "location" : 0, 395 | "value" : "@input" 396 | } 397 | ] 398 | }, 399 | "name" : { 400 | "value" : "reply" 401 | } 402 | } 403 | }, 404 | { 405 | "type" : "@text", 406 | "parameters" : { 407 | "text" : { 408 | "value" : "https:\/\/player.bilibili.com\/player.html?aid=$", 409 | "tokens" : [ 410 | { 411 | "location" : 44, 412 | "value" : "av" 413 | } 414 | ] 415 | } 416 | } 417 | }, 418 | { 419 | "type" : "@ui.render-html", 420 | "parameters" : { 421 | "showsProgress" : true, 422 | "title" : { 423 | "value" : "" 424 | }, 425 | "html" : { 426 | "value" : "\n\n\n\n \n \n