tyrantgenesis.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. const BASE_URL = "https://git.tyrantg.com/tyrantgenesis/hikerViewRules/raw/master/"
  2. const collection_password = "海阔视界,首页频道合集¥home_rule_url¥"
  3. const rule_password = "海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥"
  4. const baseParse = _ => {
  5. let res = {};
  6. let d = [];
  7. const script = fetch(MY_URL);
  8. const data_json = fetch('hiker://files/TyrantG/data/base.json');
  9. const data = JSON.parse(data_json)
  10. let fst_rule_list = []
  11. let snd_rule_list = []
  12. eval(script);
  13. d.push({
  14. title: '跑路了,崩撤卖溜',
  15. url: 'https://git.tyrantg.com/tyrantgenesis/hikerViewRules',
  16. col_type: 'text_1'
  17. })
  18. d.push({
  19. pic_url: 'http://test-homepage.dev.tyrantg.com/img/llll.gif',
  20. url: 'http://test-homepage.dev.tyrantg.com/img/llll.gif',
  21. col_type: 'pic_1_full'
  22. })
  23. data.forEach(rule => {
  24. fst_rule_list = []
  25. rule.data.forEach(item => {
  26. item.rules.forEach(each => {
  27. fst_rule_list.push(each.rule)
  28. })
  29. })
  30. writeFile("hiker://files/TyrantG/Temporary/"+rule.title+".json", JSON.stringify(fst_rule_list));
  31. d.push({
  32. title: rule.title,
  33. url: "rule://"+base64Encode(collection_password+"hiker://files/TyrantG/Temporary/"+rule.title+".json").replace(/\n/g, ''),
  34. col_type: 'text_center_1'
  35. });
  36. rule.data.forEach(item => {
  37. snd_rule_list = []
  38. item.rules.forEach(each => {
  39. snd_rule_list.push(each.rule)
  40. })
  41. writeFile("hiker://files/TyrantG/Temporary/"+rule.title+"/"+item.title+".json", JSON.stringify(snd_rule_list));
  42. d.push({
  43. title: item.title,
  44. url: "rule://"+base64Encode(collection_password+"hiker://files/TyrantG/Temporary/"+rule.title+"/"+item.title+".json").replace(/\n/g, ''),
  45. col_type: 'text_2'
  46. });
  47. item.rules.forEach(each => {
  48. d.push({
  49. title: each.title,
  50. url: "rule://"+base64Encode(rule_password+JSON.stringify(each.rule)).replace(/\n/g, ''),
  51. col_type: 'flex_button'
  52. })
  53. })
  54. d.push({
  55. col_type: 'line'
  56. });
  57. })
  58. d.push({
  59. col_type: 'line_blank'
  60. });
  61. })
  62. res.data = d;
  63. setHomeResult(res);
  64. }
  65. const homePage = _ => {
  66. let hikerRules = getLastRules(12), rules = []
  67. hikerRules.forEach(item => {
  68. rules.push(item.title)
  69. })
  70. putVar('tyrantgenesis.rules', JSON.stringify(rules))
  71. let d = [];
  72. d.push({
  73. desc: '100% && float',
  74. url: 'file:///storage/emulated/0/Android/data/com.example.hikerview/files/Documents/TyrantG/public/Home.html?time='+(new Date()).getTime(),
  75. col_type:"x5_webview_single"
  76. })
  77. setResult(d);
  78. }