예제 #1
0
#print "resp", resp
#print "content", content    
#
#print "<------>"
#
#uri = "/api/testcase-current"
#params = security.sign(uri, test_keypair)
#h = httplib2.Http()
#resp, content = h.request("http://127.0.0.1:8081%s?%s" % (uri,urlencode(params)), "GET")
#        
#print "resp", resp
#print "content", content    

#
#print "<------>"
#
#uri = "/api/testcase-queuetask"
#params = security.sign(uri, test_keypair )
#resp, content = h.request("http://127.0.0.1:8081%s?%s" % (uri,urlencode(params)), "GET")
#        print "resp", resp
#print "content", content    
#
#
uri = "/api/update-tweetstreams"
params = security.sign(uri, test_keypair )
h = httplib2.Http()
resp, content = h.request("http://127.0.0.1:8081%s?%s" % (uri,urlencode(params)), "GET")
print "resp", resp
print "content", content    

예제 #2
0
from urllib import urlencode
import httplib2
import json
import os
import sys

# fix path
sys.path.append( os.path.join( os.path.dirname( os.path.abspath(__file__) ), "..") )

from lib import security
test_keypair = "0448ec365f8589121da335e075911ec8406f7d41", "b1641edb368b10998209dae45f6e79eb416178cd"

args = security.sign("/api/stat-fingerprints", test_keypair)

h = httplib2.Http()
resp, content = h.request("http://127.0.0.1:8081/api/stat-fingerprints?%s" % urlencode(args),"GET")
        
print "resp", resp
print "content", content
예제 #3
0
# fix path
sys.path.append( os.path.join( os.path.dirname( os.path.abspath(__file__) ), "..") )

from lib import security
test_keypair = "0448ec365f8589121da335e075911ec8406f7d41", "b1641edb368b10998209dae45f6e79eb416178cd"

fingerprint = {
    "stationid": "a00001",
    "airtime": 1336351306,
    "fingerprints": [
         { "provider": "echonest",           
           "title":"la garola",
           "artist":"garompatex",
           "more":{
               "songid":"SOOLVGG1366802D39F",
           }},
      ]
 }

body_content = json.dumps(fingerprint)
args = security.sign("/api/add-fingerprint", test_keypair, content = body_content)

h = httplib2.Http()
resp, content = h.request("http://127.0.0.1:8081/api/add-fingerprint?%s" % urlencode(args), 
    "POST", body=body_content, 
    headers={'content-type':'application/json'} )
        
print "resp", resp
print "content", content    
    
예제 #4
0
#print "resp", resp
#print "content", content
#
#print "<------>"
#
#uri = "/api/testcase-current"
#params = security.sign(uri, test_keypair)
#h = httplib2.Http()
#resp, content = h.request("http://127.0.0.1:8081%s?%s" % (uri,urlencode(params)), "GET")
#
#print "resp", resp
#print "content", content

#
#print "<------>"
#
#uri = "/api/testcase-queuetask"
#params = security.sign(uri, test_keypair )
#resp, content = h.request("http://127.0.0.1:8081%s?%s" % (uri,urlencode(params)), "GET")
#        print "resp", resp
#print "content", content
#
#
uri = "/api/update-tweetstreams"
params = security.sign(uri, test_keypair)
h = httplib2.Http()
resp, content = h.request(
    "http://127.0.0.1:8081%s?%s" % (uri, urlencode(params)), "GET")
print "resp", resp
print "content", content
예제 #5
0
from urllib import urlencode
import httplib2
import json
import os
import sys

# fix path
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from lib import security
test_keypair = "0448ec365f8589121da335e075911ec8406f7d41", "b1641edb368b10998209dae45f6e79eb416178cd"

args = security.sign("/api/stat-fingerprints", test_keypair)

h = httplib2.Http()
resp, content = h.request(
    "http://127.0.0.1:8081/api/stat-fingerprints?%s" % urlencode(args), "GET")

print "resp", resp
print "content", content
예제 #6
0
    "stationid":
    "a00001",
    "airtime":
    1336351306,
    "fingerprints": [
        {
            "provider": "echonest",
            "title": "la garola",
            "artist": "garompatex",
            "more": {
                "songid": "SOOLVGG1366802D39F",
            }
        },
    ]
}

body_content = json.dumps(fingerprint)
args = security.sign("/api/add-fingerprint",
                     test_keypair,
                     content=body_content)

h = httplib2.Http()
resp, content = h.request("http://127.0.0.1:8081/api/add-fingerprint?%s" %
                          urlencode(args),
                          "POST",
                          body=body_content,
                          headers={'content-type': 'application/json'})

print "resp", resp
print "content", content
예제 #7
0
from urllib import urlencode
import httplib2
import json
import os
import sys


# fix path
sys.path.append( os.path.join( os.path.dirname( os.path.abspath(__file__) ), "..") )

from lib import security
test_keypair = "0448ec365f8589121da335e075911ec8406f7d41", "b1641edb368b10998209dae45f6e79eb416178cd"

args = security.sign("/api/stat-tweetstreams", test_keypair)

h = httplib2.Http()
resp, content = h.request("http://127.0.0.1:8081/api/stat-tweetstreams?%s" % urlencode(args),"GET")
        
print "resp", resp
print "content", content    
    
예제 #8
0
from urllib import urlencode
import httplib2
import json
import sys
import os

# fix path
sys.path.append( os.path.join( os.path.dirname( os.path.abspath(__file__) ), "..") )

from lib import security

test_keypair = "0448ec365f8589121da335e075911ec8406f7d41", "b1641edb368b10998209dae45f6e79eb416178cd"

command = {
    "station_id": "a0001",
    "query": "@la100fm",
}
body_content = json.dumps(command)

args = security.sign("/api/add-tweetstream", test_keypair, content = body_content)

h = httplib2.Http()
resp, content = h.request("http://127.0.0.1:8081/api/add-tweetstream?%s" % urlencode(args), 
    "POST", body=body_content, 
    headers={'content-type':'application/json'} )
        
print "resp", resp
print "content", content    
    
예제 #9
0
from urllib import urlencode
import httplib2
import json
import os
import sys

# fix path
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from lib import security
test_keypair = "0448ec365f8589121da335e075911ec8406f7d41", "b1641edb368b10998209dae45f6e79eb416178cd"

args = security.sign("/api/stat-tweetstreams", test_keypair)

h = httplib2.Http()
resp, content = h.request(
    "http://127.0.0.1:8081/api/stat-tweetstreams?%s" % urlencode(args), "GET")

print "resp", resp
print "content", content