Skip to content

Instantly share code, notes, and snippets.

@RoachLin
Created January 25, 2024 13:57
Show Gist options
  • Select an option

  • Save RoachLin/946b11cfc4ae003a520af3db1a73d3f5 to your computer and use it in GitHub Desktop.

Select an option

Save RoachLin/946b11cfc4ae003a520af3db1a73d3f5 to your computer and use it in GitHub Desktop.
showroom开播提醒bot:添加成员生日提醒
// 教程:https://www.bilibili.com/read/cv27985834/
var roomIDList = new Array();
roomIDList[0] = "107419"; // 大谷 映美里(=LOVE)
roomIDList[1] = "107470"; // 大場 花菜(=LOVE)
roomIDList[2] = "106820"; // 音嶋 莉沙(=LOVE)
roomIDList[3] = "106267"; // 齋藤 樹愛羅(=LOVE)
roomIDList[4] = "106268"; // 佐々木 舞香(=LOVE)
roomIDList[5] = "106270"; // 髙松 瞳(=LOVE)
roomIDList[6] = "107457"; // 瀧脇 笙古(=LOVE)
roomIDList[7] = "106016"; // 野口 衣織(=LOVE)
roomIDList[8] = "106264"; // 諸橋 沙夏(=LOVE)
roomIDList[9] = "105923"; // 山本 杏奈(=LOVE)
roomIDList[10] = "230189"; // 尾木 波菜(≠ME)
roomIDList[11] = "230161"; // 落合 希来里(≠ME)
roomIDList[12] = "230160"; // 蟹沢 萌子(≠ME)
roomIDList[13] = "228540"; // 河口 夏音(≠ME)
roomIDList[14] = "230185"; // 川中子 奈月心(≠ME)
roomIDList[15] = "230164"; // 櫻井 もも(≠ME)
roomIDList[16] = "230175"; // 菅波 美玲(≠ME)
roomIDList[17] = "230181"; // 鈴木 瞳美(≠ME)
roomIDList[18] = "230174"; // 谷崎 早耶(≠ME)
roomIDList[19] = "230219"; // 冨田 菜々風(≠ME)
roomIDList[20] = "230208"; // 永田 詩央里(≠ME)
roomIDList[21] = "230171"; // 本田 珠由記(≠ME)
roomIDList[22] = "387113"; // 逢田 珠里依(≒JOY)
roomIDList[23] = "387127"; // 天野 香乃愛(≒JOY)
roomIDList[24] = "387845"; // 市原 愛弓(≒JOY)
roomIDList[25] = "387812"; // 江角 怜音(≒JOY)
roomIDList[26] = "387179"; // 大信田 美月(≒JOY)
roomIDList[27] = "387187"; // 大西 葵(≒JOY)
roomIDList[28] = "150710"; // 小澤 愛実(≒JOY)
roomIDList[29] = "387836"; // 髙橋 舞(≒JOY)
roomIDList[30] = "387164"; // 藤沢 莉子(≒JOY)
roomIDList[31] = "387863"; // 村山 結香(≒JOY)
roomIDList[32] = "387209"; // 山田 杏佳(≒JOY)
roomIDList[33] = "387814"; // 山野 愛月(≒JOY)
roomIDList[34] = "139470"; // =LOVE 山本杏奈の「教えて、花便り」
roomIDList[35] = "272301"; // のいみーのいみ。
roomIDList[36] = "402345"; // 火曜はじょ〜いドン!
var liveStatusList = new Array();
for (var i = 0; i < roomIDList.length; ++i)
{
liveStatusList[i] = 1;
}
var birthdayList = new Array();
birthdayList[0] = "3.15" ; // 大谷 映美里(=LOVE)
birthdayList[1] = "2.4" ; // 大場 花菜(=LOVE)
birthdayList[2] = "8.11" ; // 音嶋 莉沙(=LOVE)
birthdayList[3] = "11.26"; // 齋藤 樹愛羅(=LOVE)
birthdayList[4] = "1.21" ; // 佐々木 舞香(=LOVE)
birthdayList[5] = "1.19" ; // 髙松 瞳(=LOVE)
birthdayList[6] = "7.9" ; // 瀧脇 笙古(=LOVE)
birthdayList[7] = "4.26" ; // 野口 衣織(=LOVE)
birthdayList[8] = "8.3" ; // 諸橋 沙夏(=LOVE)
birthdayList[9] = "11.30"; // 山本 杏奈(=LOVE)
birthdayList[10] = "5.8" ; // 尾木 波菜(≠ME)
birthdayList[11] = "5.22" ; // 落合 希来里(≠ME)
birthdayList[12] = "10.25"; // 蟹沢 萌子(≠ME)
birthdayList[13] = "7.29" ; // 河口 夏音(≠ME)
birthdayList[14] = "9.26" ; // 川中子 奈月心(≠ME)
birthdayList[15] = "4.13" ; // 櫻井 もも(≠ME)
birthdayList[16] = "2.5" ; // 菅波 美玲(≠ME)
birthdayList[17] = "4.13" ; // 鈴木 瞳美(≠ME)
birthdayList[18] = "10.7" ; // 谷崎 早耶(≠ME)
birthdayList[19] = "7.17" ; // 冨田 菜々風(≠ME)
birthdayList[20] = "4.2" ; // 永田 詩央里(≠ME)
birthdayList[21] = "2.27" ; // 本田 珠由記(≠ME)
birthdayList[22] = "9.13" ; // 逢田 珠里依(≒JOY)
birthdayList[23] = "1.21" ; // 天野 香乃愛(≒JOY)
birthdayList[24] = "8.21" ; // 市原 愛弓(≒JOY)
birthdayList[25] = "4.26" ; // 江角 怜音(≒JOY)
birthdayList[26] = "9.27" ; // 大信田 美月(≒JOY)
birthdayList[27] = "8.6" ; // 大西 葵(≒JOY)
birthdayList[28] = "4.9" ; // 小澤 愛実(≒JOY)
birthdayList[29] = "2.22" ; // 髙橋 舞(≒JOY)
birthdayList[30] = "1.16" ; // 藤沢 莉子(≒JOY)
birthdayList[31] = "2.15" ; // 村山 結香(≒JOY)
birthdayList[32] = "2.2" ; // 山田 杏佳(≒JOY)
birthdayList[33] = "10.21"; // 山野 愛月(≒JOY)
birthdayList[34] = "11.21"; // 指原 莉乃
var birthdayStatusList = new Array();
for (var i = 0; i < birthdayList.length; ++i)
{
birthdayStatusList[i] = 2023;
}
var memberList = new Array();
memberList[0] = "大谷 映美里(=LOVE)";
memberList[1] = "大場 花菜(=LOVE)";
memberList[2] = "音嶋 莉沙(=LOVE)";
memberList[3] = "齋藤 樹愛羅(=LOVE)";
memberList[4] = "佐々木 舞香(=LOVE)";
memberList[5] = "髙松 瞳(=LOVE)";
memberList[6] = "瀧脇 笙古(=LOVE)";
memberList[7] = "野口 衣織(=LOVE)";
memberList[8] = "諸橋 沙夏(=LOVE)";
memberList[9] = "山本 杏奈(=LOVE)";
memberList[10] = "尾木 波菜(≠ME)";
memberList[11] = "落合 希来里(≠ME)";
memberList[12] = "蟹沢 萌子(≠ME)";
memberList[13] = "河口 夏音(≠ME)";
memberList[14] = "川中子 奈月心(≠ME)";
memberList[15] = "櫻井 もも(≠ME)";
memberList[16] = "菅波 美玲(≠ME)";
memberList[17] = "鈴木 瞳美(≠ME)";
memberList[18] = "谷崎 早耶(≠ME)";
memberList[19] = "冨田 菜々風(≠ME)";
memberList[20] = "永田 詩央里(≠ME)";
memberList[21] = "本田 珠由記(≠ME)";
memberList[22] = "逢田 珠里依(≒JOY)";
memberList[23] = "天野 香乃愛(≒JOY)";
memberList[24] = "市原 愛弓(≒JOY)";
memberList[25] = "江角 怜音(≒JOY)";
memberList[26] = "大信田 美月(≒JOY)";
memberList[27] = "大西 葵(≒JOY)";
memberList[28] = "小澤 愛実(≒JOY)";
memberList[29] = "髙橋 舞(≒JOY)";
memberList[30] = "藤沢 莉子(≒JOY)";
memberList[31] = "村山 結香(≒JOY)";
memberList[32] = "山田 杏佳(≒JOY)";
memberList[33] = "山野 愛月(≒JOY)";
memberList[34] = "指原 莉乃";
console.show();
while (true)
{
var send = ""
for (var i = 0; i < roomIDList.length; ++i)
{
// 如果网络不稳定、断网,此处就会报错,只能直接退出循环,休眠一会儿
try
{
var respond = http.get("https://www.showroom-live.com/api/live/live_info?room_id=" + roomIDList[i]);
}
catch (err)
{
console.error(err);
break;
}
if (respond.statusCode != 200)
{
break; // 访问被拒绝,同样是退出循环,休眠一会儿
}
else
{
// 此处可能出现connection reset错误,原因不明,只能同样是退出循环,休眠一会儿
try
{
var json = respond.body.json();
}
catch (err)
{
console.error(err);
break;
}
console.log(json.room_name, json.live_status)
if (json.live_status != liveStatusList[i])
{
liveStatusList[i] = json.live_status
if (json.live_status == 2)
{
send = send + json.room_name + " 直播中!" + "\n" + "\n";
console.log(json.room_name + " 直播中!");
}
}
if (i == roomIDList.length - 1)
{
var date = new Date();
var today = (date.getMonth() + 1).toString() + "." + date.getDate().toString();
var flag = false;
for (var j = 0; j < birthdayList.length; ++j)
{
if (today == birthdayList[j] && date.getFullYear() != birthdayStatusList[j])
{
send = send + memberList[j] + " 今天生日!" + "\n" + "\n";
birthdayStatusList[j] = date.getFullYear();
flag = true;
console.log(memberList[j] + " 今天生日!");
}
}
if (flag)
{
send = send + date.getFullYear().toString() + "." + today + "\n" + "\n";
}
}
}
sleep(100); // 每次查询之间象征性地休眠一会儿
}
if (send == "")
{
click(520, 80) // 如果什么都不用发,也点击一下屏幕,防止手机熄屏
}
else
{
var date = new Date();
var time = date.toTimeString();
send += time.replace("GMT+0800 (GMT+08:00)", "");
setText(send);
sleep(100); // 休眠一会儿,防止发送键点太快了,也防止QQ检测
while (!click("发送"));
}
var date = new Date();
var time = date.toTimeString();
console.log(time.replace("GMT+0800 (GMT+08:00)", ""));
sleep(30 * 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment