def test_quote_of_the_day_encoding(self): spanish_quote_of_the_day = wikiquotes.quote_of_the_day("spanish") self.assertTrue( language_manager.is_unicode(spanish_quote_of_the_day[0])) self.assertTrue( language_manager.is_unicode(spanish_quote_of_the_day[1])) english_quote_of_the_day = wikiquotes.quote_of_the_day("english") self.assertTrue( language_manager.is_unicode(english_quote_of_the_day[0])) self.assertTrue( language_manager.is_unicode(english_quote_of_the_day[1]))
def quote(): engine.say("Here is a quote for you") engine.runAndWait() quote = wikiquotes.quote_of_the_day("english") quote = quote[0] engine.say(quote) engine.runAndWait()
async def on_message(message): if message.content.startswith("<usage"): await message.channel.send("Type `<search author-name` to search for an author. Type `<day` to display the Wikiquotes quote of the day.") if message.content.startswith("<day"): await message.channel.send(wikiquotes.quote_of_the_day("english")) if message.content.startswith("<pacer"): await message.channel.send("""The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly but gets faster each minute after you hear this signal. A single lap should be completed every time you hear this sound. Remember to run in a straight line and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark. Get ready!… Start.""") await client.process_commands(message)
def test_spanish_quote_of_the_day_encoding_invariance(self): quote_of_the_day = wikiquotes.quote_of_the_day("spanish") self.assertEqual(quote_of_the_day, _qotd("Spanish")) self.assertEqual(quote_of_the_day, _qotd("spanish")) self.assertEqual(quote_of_the_day, _qotd("es")) self.assertEqual(quote_of_the_day, _qotd("Español")) self.assertEqual(quote_of_the_day, _qotd("español")) self.assertEqual(quote_of_the_day, _qotd(u"Spanish")) self.assertEqual(quote_of_the_day, _qotd(u"spanish")) self.assertEqual(quote_of_the_day, _qotd(u"es")) self.assertEqual(quote_of_the_day, _qotd(u"Español")) self.assertEqual(quote_of_the_day, _qotd(u"español"))
def post(st): n = random.randint(0, 2) if st is 0: t = tags1(n) rt = str((wikiquotes.quote_of_the_day("english")[0])) #print(rt+t) return (rt + t) else: t = tags2(n) cn = ChuckNorris() data = str(cn.random()) while len(data) > 270: data = cn.random() #print(data+t) return (data + t)
def test_english_quote_of_the_day_encoding_invariance(self): quote_of_the_day = wikiquotes.quote_of_the_day("english") self.assertEqual(quote_of_the_day, _qotd("English")) self.assertEqual(quote_of_the_day, _qotd("english")) self.assertEqual(quote_of_the_day, _qotd("en")) self.assertEqual(quote_of_the_day, _qotd("Inglés")) self.assertEqual(quote_of_the_day, _qotd("Ingles")) self.assertEqual(quote_of_the_day, _qotd("ingles")) self.assertEqual(quote_of_the_day, _qotd(u"English")) self.assertEqual(quote_of_the_day, _qotd(u"english")) self.assertEqual(quote_of_the_day, _qotd(u"en")) self.assertEqual(quote_of_the_day, _qotd(u"Inglés")) self.assertEqual(quote_of_the_day, _qotd(u"Ingles")) self.assertEqual(quote_of_the_day, _qotd(u"ingles"))
def _qotd(string): return wikiquotes.quote_of_the_day(string)
def get(self): quote = wikiquotes.quote_of_the_day("english") json_string = {"quote": quote[0], "author": quote[1]} return json_string
print("Sending the request") theList = wikiquotes.get_quotes("Musk", "English") if theList: ohbot.reset() ohbot.wait(1) print("Success") print(theList) print(len(theList)) text = theList[random.randint(0, len(theList) - 1)] print(text) ohbot.say(text) ohbot.wait(1) else: print("Problem connecting to the server") print("Sending the second request") quoteOfTheDay = wikiquotes.quote_of_the_day("English") newText = quoteOfTheDay[0] print(newText) print(type(newText)) # # ohbot.say(str(newText)) ohbot.close()