Exemple #1
0
 def GET(self):
     #获取输入参数
     data = web.input()
     #从WeixinService中获取该服务号的相关信息
     fwh = userdb.get_weixin_obj(weixin_name=data.name)
     msg = GetMessage(data)
     if msg.is_from_weixin(fwh.token):
         return msg.echostr
     else:
         return msg.signature
Exemple #2
0
# -*- coding: utf-8 -*-
import hashlib
import web
#import lxml
import time
import os
import urllib2,json
import sys
#add parent directory to sys.path
sys.path.append(os.path.split(os.path.dirname(__file__))[0])

#from lxml import etree
#import pylibmc
from common import templates_root
from message import GetMessage,PostMessage
class Data :
    def __init__(self):
        self.signature="62f883efec0de69cac4cb4f23c706b36db1ce28a"
        self.echostr="5990745519727602978"
        self.timestamp="1394634018"
        self.nonce="1394829133"
    
data =Data()
print data.signature
msg = GetMessage(data)
if msg.is_from_weixin():
    print msg.echostr
Exemple #3
0
# -*- coding: utf-8 -*-
import hashlib
import web
#import lxml
import time
import os
import urllib2,json
import sys
#add parent directory to sys.path
sys.path.append(os.path.split(os.path.dirname(__file__))[0])

#from lxml import etree
#import pylibmc
from common import templates_root
from message import GetMessage,PostMessage
class Data :
    def __init__(self):
        self.signature="62f883efec0de69cac4cb4f23c706b36db1ce28a"
        self.echostr="5990745519727602978"
        self.timestamp="1394634018"
        self.nonce="1394829133"
    
data =Data()
print data.signature
msg = GetMessage(data)
if msg.is_from_weixin():
    print msg.echostr
Exemple #4
0
 def GET(self):
     #获取输入参数
     data = web.input()
     msg = GetMessage(data)
     if msg.is_from_weixin():
         return msg.echostr