Exemplo n.º 1
0
    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:
Exemplo n.º 2
0
 def test_topic_schmopic_12(self):
     intext = "FINTECH2015"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "SCHMINTECH2015")
Exemplo n.º 3
0
 def test_topic_schmopic_13(self):
     intext = "#SnotQuotes"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "#SnotSchmotes")
Exemplo n.º 4
0
 def test_smart(self):
     intext = "smart"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "schmart")
Exemplo n.º 5
0
 def test_topic_schmopic_11(self):
     intext = "American Sniper"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "American Schmiper")
Exemplo n.º 6
0
 def test_topic_schmopic_10(self):
     intext = "Yakuza 5"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, False)
Exemplo n.º 7
0
 def test_sniper(self):
     intext = "sniper"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "schmiper")
Exemplo n.º 8
0
 def test_topic_schmopic_8(self):
     intext = "No Man's Sky"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "No Man's Schmy")
Exemplo n.º 9
0
 def test_topic_schmopic_9(self):
     intext = "Mariah"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "Schmariah")
Exemplo n.º 10
0
 def test_topic_schmopic_6(self):
     intext = "#XFactorSemiFinal"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "#XFactorSemiSchminal")
Exemplo n.º 11
0
 def test_topic_schmopic_7(self):
     intext = "#PlayStationExperience"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "#PlayStationSchmexperience")
Exemplo n.º 12
0
 def test_topic_schmopic_5(self):
     intext = "#100kHappyBailey"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "#100kHappySchmailey")
Exemplo n.º 13
0
 def test_topic_schmopic_4(self):
     intext = "#hayesvideo"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "#schmayesvideo")
Exemplo n.º 14
0
 def test_topic_schmopic_3(self):
     intext = "Uncharted 4"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, False)
Exemplo n.º 15
0
 def test_topic_schmopic_2(self):
     intext = "#CameronMustGo"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "#CameronMustSchmo")
Exemplo n.º 16
0
 def test_topic_schmopic_1(self):
     intext = "Until Dawn"
     outtext = schpy.topic_schmopic(intext)
     self.assertEqual(outtext, "Until Schmawn")