parser.add_argument('-t', '--topic', help="Topic to convert") parser.add_argument('-l', '--location', default="random", choices=sorted(WOE_IDS), help="Location of trending topics") args = parser.parse_args() if args.location == "random": args.location = random.choice(WOE_IDS.keys()) data = load_yaml(args.yaml) saved_trends = load_list(args.cache) print(saved_trends) if args.topic: intext = args.topic outtext = schpy.topic_schmopic(args.topic) print(args.topic) else: print("Get a topic from Twitter") trends = get_trending_topics_from_twitter(args.location) pprint(trends) if not trends: sys.exit("Nowt found, try later") for trend in trends: intext = trend outtext = schpy.topic_schmopic(trend) if outtext: break else:
def test_topic_schmopic_12(self): intext = "FINTECH2015" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "SCHMINTECH2015")
def test_topic_schmopic_13(self): intext = "#SnotQuotes" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "#SnotSchmotes")
def test_smart(self): intext = "smart" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "schmart")
def test_topic_schmopic_11(self): intext = "American Sniper" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "American Schmiper")
def test_topic_schmopic_10(self): intext = "Yakuza 5" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, False)
def test_sniper(self): intext = "sniper" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "schmiper")
def test_topic_schmopic_8(self): intext = "No Man's Sky" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "No Man's Schmy")
def test_topic_schmopic_9(self): intext = "Mariah" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "Schmariah")
def test_topic_schmopic_6(self): intext = "#XFactorSemiFinal" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "#XFactorSemiSchminal")
def test_topic_schmopic_7(self): intext = "#PlayStationExperience" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "#PlayStationSchmexperience")
def test_topic_schmopic_5(self): intext = "#100kHappyBailey" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "#100kHappySchmailey")
def test_topic_schmopic_4(self): intext = "#hayesvideo" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "#schmayesvideo")
def test_topic_schmopic_3(self): intext = "Uncharted 4" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, False)
def test_topic_schmopic_2(self): intext = "#CameronMustGo" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "#CameronMustSchmo")
def test_topic_schmopic_1(self): intext = "Until Dawn" outtext = schpy.topic_schmopic(intext) self.assertEqual(outtext, "Until Schmawn")