Skip to content

Instantly share code, notes, and snippets.

View janelin612's full-sized avatar
🐔
newbie

Tars janelin612

🐔
newbie
View GitHub Profile
@janelin612
janelin612 / doting.js
Created February 24, 2021 07:26
從豆丁森友會撈島民資料
const fetch = require('node-fetch');
const fs = require('fs');
const API = 'https://doting.tw';
const PATH_ANIMAL_TYPE = "./animal-type.json";
const PATH_ALL_ANIMALS = "./all-animals.json";
/**
* 建立API需要的驗證資訊
*/
const cvt = require("xml-js");
const fs = require("fs");
let urlList = [];
["/","/page2","/page3"].forEach((router) => {
urlList.push({
loc: `${BASE_URL}${router}`,
});
});
function decode(text) {
if (!text)
return "";
//string to byte[]
let byteArr = [];
for (let i = 0; i < text.length; i++) {
byteArr.push(text.charCodeAt(i));
}
const location="C:/Users/YOUR_NAME/AppData/Roaming/Mozilla/Firefox/Profiles/xxx.xxx";
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(location+'/places.sqlite');
db.serialize(function () {
db.each("DELETE FROM moz_places WHERE visit_count <=2 AND last_visit_date < CAST(strftime('%s', datetime('2019-03-01')) AS INT)*1000000",
function (err, row) {
console.log(row);
}
);
(7)
// 1 inch = 2.54cm
private static final float cmPerInch=1/2.54;
public float convertCmToInch(float cm){
return cm*cmPerInch;
}
(8)
1. 沒頭沒尾 我根本不知道這是什麼method XD