Exemplo n.º 1
0
def when(inp, say=None):
    #"Shows the countdown to the new episode of My Little Pony: Friendship is Magic!"

    try:
        ep = ponyapi.newest()
        now, then, td = get_time(ep)
        seasonep = ""

        if inp == "discord":
            return "%s will air on %s" % (ep[u"name"], DDate(then))

        if ep[u"is_movie"]:
            seasonep = "(a movie)"
        else:
            seasonep = "(season %d episode %d)" % (ep[u"season"],
                                                   ep[u"episode"])

        reply = "%s %s will air on %s in %d days!" % (
            ep[u"name"], seasonep, then.strftime("%a, %d %b %Y %H:%M:%S"),
            td.days)

        return reply

    except:
        return "404! We're on hiatus!"
Exemplo n.º 2
0
def countdown(inp, say=None):
    "Shows the countdown to the new episode of My Little Pony: Friendship is Magic!"
    now = datetime.datetime(2006, 1, 1)
    now = now.now()
    ep = ponyapi.newest()
    then = now.fromtimestamp(int(ep[u"air_date"]))
    td = then - now

    seasonep = ""

    if ep[u"is_movie"]:
        seasonep = "(a movie)"
    else:
        seasonep = "(season %d episode %d)" % (ep[u"season"], ep[u"episode"])

    reply = "%s %s will air on %s in %d days!" % (
        ep[u"name"], seasonep, then.strftime("%a, %d %b %Y %H:%M:%S"), td.days)

    return reply
Exemplo n.º 3
0
def countdown(inp, say=None):
    "Shows the countdown to the new episode of My Little Pony: Friendship is Magic!"
    now = datetime.datetime(2006, 1, 1)
    now = now.now()
    ep = ponyapi.newest()
    then = now.fromtimestamp(int(ep[u"air_date"]))
    td = then-now

    seasonep = ""

    if ep[u"is_movie"]:
        seasonep = "(a movie)"
    else:
        seasonep = "(season %d episode %d)" % (ep[u"season"], ep[u"episode"])

    reply = "%s %s will air on %s in %d days!" % (
                ep[u"name"], seasonep, then.strftime("%a, %d %b %Y %H:%M:%S"),
                td.days)

    return reply
Exemplo n.º 4
0
Arquivo: pony.py Projeto: Xe/h2
def when(inp, say=None):
    #"Shows the countdown to the new episode of My Little Pony: Friendship is Magic!"

    try:
        ep = ponyapi.newest()
        now, then, td = get_time(ep)
        seasonep = ""

        if inp == "discord":
            return "%s will air on %s" % (ep[u"name"], DDate(then))

        if ep[u"is_movie"]:
            seasonep = "(a movie)"
        else:
            seasonep = "(season %d episode %d)" % (ep[u"season"], ep[u"episode"])

        reply = "%s %s will air on %s in %d days!" % (
                    ep[u"name"], seasonep, then.strftime("%a, %d %b %Y %H:%M:%S"),
                    td.days)

        return reply

    except:
        return "404! We're on hiatus!"
Exemplo n.º 5
0
 def test_newest(self):
     ponyapi.newest()
Exemplo n.º 6
0
 def test_newest(self):
     try:
         ponyapi.newest()
     except:
         print "probably on hiatus"
Exemplo n.º 7
0
 def test_newest(self):
     try:
         ponyapi.newest()
     except:
         print "probably on hiatus"
Exemplo n.º 8
0
 def test_newest(self):
     ponyapi.newest()