commit 67a1377c0028ede4b1c1380c983a2f5630cbc885 Author: Yuri Moens Date: Thu Oct 22 22:41:36 2020 +0200 Initial commit diff --git a/.conf.example b/.conf.example new file mode 100644 index 0000000..bc2a1cd --- /dev/null +++ b/.conf.example @@ -0,0 +1,2 @@ +chat id = 0123456789 +bot token = 9876543210:ABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3842932 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.conf \ No newline at end of file diff --git a/ql b/ql new file mode 100644 index 0000000..cf6b454 --- /dev/null +++ b/ql @@ -0,0 +1,3 @@ +Example Quest Name +Example Tamer Name|Example Tamer Quest Name +Example Tamer Name|Example Tamer Quest Name|Example Pet Type \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d318ad0 --- /dev/null +++ b/readme.md @@ -0,0 +1,83 @@ +``` +cp .conf.example .conf +``` + +Enter chat ID on line 1, bot token on line 2. + +Add the quests you want to track in `ql`. One quest per line. + +You can give it a different name by prepending it with `|`. This is mostly useful for Pet Tamer/Legendary Pet names. +You can also append it with `|` to pass through any reminder to the notification message. + +# Master Tamer/Pet lists + +These lists are useful for the "beat Tamers/Pets with all pets" achievements. (eg Aquatic Acquiescence) +You can add `|` to the end so the bot sends you a reminder of what type you are currently on. + +For example if I'm working on doing the aquatic achievement I can use: + +``` +Nightwatcher Merayl|Training with the Nightwatchers|aquatic +``` + +Once I've done this trainer with aquatic pets I simply change the type to the next one I want to do. + +## Broken Isles Master Tamers + +``` +Nightwatcher Merayl|Training with the Nightwatchers +Tiffany Nelson|Fight Night: Tiffany Nelson +Sir Galveston|Fight Night: Sir Galveston +Grixis Tinypop|Tiny Poacher, Tiny Animals +Robert Craig|My Beasts's Bidding +Aulier|The Master of Pets +Varenne|Chopped +Xorvasc|Dealing with Satyrs +Bodhi Sunwayver|Fight Night: Bodhi Sunwayver +Amalia|Fight Night: Amalia +Bredda Tenderhide|Training with Bredda +Odrogg|Snail Fight! +Trapper Jarrun|Jarrun's Ladder +Master Tamer Flummox|Flummoxed +Durian Strongfruit|Training with Durian +``` + +## Argus Pets + +``` +Ruinhoof|Ruinhoof +Deathscreech|Deathscreech +Corrupted Blood of Argus|Corrupted Blood of Argus +Watcher|Watcher +Minixis|Minixis +Foulclaw|Foulclaw +Retch|Retch +Mar'cuus|Mar'cuus +One-of-Many|One-of-Many +``` + +## BFA Master Tamers + +``` +Captain Hermes|Crab People +Dilbert McClint|Night Horrors +Michael Skarn|What's the Buzz? +Leana Darkwind|Captured Evil +Delia Hanako|That's a Big Carcass +Lozu|Marshdwellers +Korval Darkbeard|Accidental Dread +Sizzik|Snakes on a Terrace +Karaga|Critters are Friends, Not Food +Zujai|Small Beginnings +Eddie Fixit|Automated Chaos +Fizzie Sparkwhistle|Rogue Azerite +Ellie Vern|Sea Creatures Are Weird +Kwint|Not So Bad Down Here +Burly|Strange Looking Dogs +Grady Prett|Pack Leader +Keeyo|Keeyo's Champions of Vol'dun +Kusa|Desert Survivors +Talia Sparkbrow|Add More to the Collection +``` + +## SL Master Tamers \ No newline at end of file diff --git a/wqb.py b/wqb.py new file mode 100644 index 0000000..25343e3 --- /dev/null +++ b/wqb.py @@ -0,0 +1,56 @@ +import json +import urllib2 +import logging + +logging.basicConfig(filename='wqb.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', encoding='utf-8', level=logging.DEBUG) + +sl = urllib2.urlopen(urllib2.Request('https://www.wowhead.com/world-quests/sl/eu', headers={'User-Agent': 'Edg/79.0.309.43'})).read() +bfa = urllib2.urlopen(urllib2.Request('https://www.wowhead.com/world-quests/bfa/eu', headers={'User-Agent': 'Edg/79.0.309.43'})).read() +legion = urllib2.urlopen(urllib2.Request('https://www.wowhead.com/world-quests/legion/eu', headers={'User-Agent': 'Edg/79.0.309.43'})).read() + +config = open('.conf', 'r') +config = config.readlines() + +chat_id = config[0].split('=')[1].strip() +token = config[1].split('=')[1].strip() + +def send_message(input): + data = { + 'chat_id': chat_id, + 'text': input + } + + req = urllib2.Request('https://api.telegram.org/bot' + token + '/sendMessage') + req.add_header('Content-Type', 'application/json') + + response = urllib2.urlopen(req, json.dumps(data)) + + logging.info('sent message ' + input) + +qlist = open('ql','r') +qlist = qlist.readlines() + +for quest in qlist: + quest = quest.rstrip() + qsplit = quest.split('|') + if len(qsplit) == 2: + if (sl.find(qsplit[1]) != -1): + send_message('[SL Tamer] ' + qsplit[0] + ' - ' + qsplit[1]) + if (bfa.find(qsplit[1]) != -1): + send_message('[BFA Tamer] ' + qsplit[0] + ' - ' + qsplit[1]) + if (legion.find(qsplit[1]) != -1): + send_message('[Legion Tamer] ' + qsplit[0] + ' - ' + qsplit[1]) + elif len(qsplit) == 3: + if (sl.find(qsplit[1]) != -1): + send_message('[SL Tamer] ' + qsplit[0] + ' - ' + qsplit[1] + ' - ' + qsplit[2]) + if (bfa.find(qsplit[1]) != -1): + send_message('[BFA Tamer] ' + qsplit[0] + ' - ' + qsplit[1] + ' - ' + qsplit[2]) + if (legion.find(qsplit[1]) != -1): + send_message('[Legion Tamer] ' + qsplit[0] + ' - ' + qsplit[1] + ' - ' + qsplit[2]) + else: + if (sl.find(quest) != -1): + send_message('[SL] ' + quest) + if (bfa.find(quest) != -1): + send_message('[BFA] ' + quest) + if (legion.find(quest) != -1): + send_message('[Legion] ' + quest)