-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (35 loc) · 1.17 KB
/
main.py
File metadata and controls
49 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import webapp2
from google.appengine.ext import ndb
from google.appengine.api import mail
from datetime import datetime
from bingimage import postBingImageToWeibo
from bingimage import postBingImageToTwitter
from settings import *
class PostImageToSinaWeibo(webapp2.RequestHandler):
def get(self):
prefix = u"#Bing# #Wallpaper# #Photo#."
userUrl = BING_GLOBAL
postBingImageToWeibo(prefix, userUrl)
import time
time.sleep(5)
prefix = u'每日 #必应美图# #壁纸#。'
userUrl = BING_CHINA
postBingImageToWeibo(prefix, userUrl)
class PostImageToTwitter(webapp2.RequestHandler):
def get(self):
prefix = u"#Bing #Wallpaper #Photo."
userUrl = BING_GLOBAL
postBingImageToTwitter(prefix, userUrl)
import time
time.sleep(60)
prefix = u'每日 #必应美图 #壁纸。'
userUrl = BING_CHINA
postBingImageToTwitter(prefix, userUrl)
APP = webapp2.WSGIApplication(
[
('/postimagetosinaweibo', PostImageToSinaWeibo),
('/postimagetotwitter', PostImageToTwitter)
])