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