コード例 #1
0
# NSONE will use config in ~/.nsone by default
nsone = NSONE()

# to specify an apikey here instead, use:

# from nsone import Config
# config = Config()
# config.createFromAPIKey('qACMD09OJXBxT7XOuRs8')
# nsone = NSONE(config=config)

# create a zone to play in
zone = nsone.createZone('testzone.com')

# create an NSONE API data source
sourceAPI = nsone.datasource()
s = sourceAPI.create('my api source', 'nsone_v1')
sourceID = s['id']

# create feeds which will drive the meta data for each answer
# we'll use the id of these feeds when we connect the feeds to the
# answer meta below
feedAPI = nsone.datafeed()
feed1 = feedAPI.create(sourceID,
                       'feed to server1',
                       config={'label': 'server1'})

feed2 = feedAPI.create(sourceID,
                       'feed to server2',
                       config={'label': 'server2'})
コード例 #2
0
# NSONE will use config in ~/.nsone by default
nsone = NSONE()

# to specify an apikey here instead, use:

# from nsone import Config
# config = Config()
# config.createFromAPIKey('qACMD09OJXBxT7XOuRs8')
# nsone = NSONE(config=config)

# create a zone to play in
zone = nsone.createZone('testzone.com')

# create an NSONE API data source
sourceAPI = nsone.datasource()
s = sourceAPI.create('my api source', 'nsone_v1')
sourceID = s['id']

# create feeds which will drive the meta data for each answer
# we'll use the id of these feeds when we connect the feeds to the
# answer meta below
feedAPI = nsone.datafeed()
feed1 = feedAPI.create(sourceID,
                       'feed to server1',
                       config={'label': 'server1'})

feed2 = feedAPI.create(sourceID,
                       'feed to server2',
                       config={'label': 'server2'})