当前位置: 首页>>代码示例>>Python>>正文


Python Firebase.post方法代码示例

本文整理汇总了Python中firebase.Firebase.post方法的典型用法代码示例。如果您正苦于以下问题:Python Firebase.post方法的具体用法?Python Firebase.post怎么用?Python Firebase.post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在firebase.Firebase的用法示例。


在下文中一共展示了Firebase.post方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: schedule

# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import post [as 别名]
    def schedule(self, file_path):
        track = Firebase(FIREBASE_URL + "tracks/")

        track_data = {}
        track_data["url"] = file_path.replace(os.path.join(os.getcwd(), "jukebox"), "")
        track_data["offset"] = self.play_time(file_path)

        track.post(track_data)
开发者ID:a2lin,项目名称:secret-octo-wookie,代码行数:10,代码来源:audio.py

示例2: process

# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import post [as 别名]
def process(file):
    f = open(file, 'rU')
    reader = csv.DictReader(f, fieldnames=fieldnames)
    i = 0
    rows = list(reader)
    l = len(rows)
    for row in rows:
        id = row['CAMIS']
        inspect_loc = "https://eat-here-or-there.firebaseio.com/nyc/restaurants/{0}/inspections".format(id)

        fire_inspection = Firebase(inspect_loc, token)

        del row['CAMIS']
        try:
            fire_inspection.post(row)
        except (UnicodeDecodeError, requests.exceptions.ConnectionError) as e:
            print row
        i += 1
        printProgress(i, l, prefix = 'Progress:', suffix = 'Complete', barLength = 50)
开发者ID:taha7464,项目名称:ehot,代码行数:21,代码来源:inspect.py

示例3:

# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import post [as 别名]
#     # collect the files
#     if f.rsplit('.', 1)[1].lower() in ['mp3', 'aif', 'aiff', 'aifc', 'wav']:
#         # file_list.append(os.path.join(directory,f))
#         data = {}
#         data['file_name'] = f
#         data['bpm'] = 140
#         data['RNG'] = 1
#         data['file_type'] = "instrumental"
#         data['start_time'] = 30
#         data['volume'] = 1.0
#         data['song_name'] = f[:-4]
#         # Need to add in ID by hand
#         song_db.post(data)


ff = os.listdir(VOCAL_DIR)
for f in ff:
    # collect the files
    if f.rsplit('.', 1)[1].lower() in ['mp3', 'aif', 'aiff', 'aifc', 'wav']:
        # file_list.append(os.path.join(directory,f))
        data = {}
        data['file_name'] = f
        data['bpm'] = 140
        data['RNG'] = 1
        data['file_type'] = "vocal"
        data['start_time'] = 30
        data['volume'] = 1.0
        data['song_name'] = f[:-4]
        # Need to add in ID by hand
        song_db.post(data)
开发者ID:a2lin,项目名称:secret-octo-wookie,代码行数:32,代码来源:populate_firebase_songs.py

示例4: Firebase

# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import post [as 别名]
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 06 11:42:45 2016

@author: Claudio
"""
from firebase import Firebase
f = Firebase('https://wesee-dw.firebaseio.com/teste')
f.post({'text': 'Hello'})
开发者ID:ClaudioSiervi,项目名称:ETL_PDF,代码行数:11,代码来源:test_api_rest.py

示例5: Firebase

# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import post [as 别名]
data = []

ff = os.listdir(INSTRUMENTAL_DIR)
for f in ff:
    # collect the files
    if f.rsplit('.', 1)[1].lower() in ['mp3', 'aif', 'aiff', 'aifc', 'wav']:
        # file_list.append(os.path.join(directory,f))
        file_path = os.path.join(INSTRUMENTAL_DIR, f)
        song = audio.LocalAudioFile(file_path).analysis
        song_feats = {}
        song_feats['loudness'] = song.loudness
        song_feats['tempo'] = song.tempo.get('value')
        song_feats['name'] = f.rsplit('.',1)[0]
        data.append(song_feats)

similarity_instrumental.post(data)

#################### COPY PASTED ##################
# similarity_vocal = Firebase(FIREBASE_URL + "similarity_vocal/")
# data = []

# ff = os.listdir(VOCAL_DIR)
# for f in ff:
#     # collect the files
#     if f.rsplit('.', 1)[1].lower() in ['mp3', 'aif', 'aiff', 'aifc', 'wav']:
#         # file_list.append(os.path.join(directory,f))
#         file_path = os.path.join(VOCAL_DIR, f)
#         song = audio.LocalAudioFile(file_path).analysis
#         song_feats = {}
#         song_feats['loudness'] = song.loudness
#         song_feats['tempo'] = song.tempo.get('value')
开发者ID:a2lin,项目名称:secret-octo-wookie,代码行数:33,代码来源:populate_firebase.py

示例6: create_token

# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import post [as 别名]
from firebase import Firebase
from firebase_token_generator import create_token
import time
import random


auth_payload = {"uid":"k6wJ1M33MnaTiuRGU5IrFTwM5H53"}
token = create_token("1ufUtMReQxZlUe8kHdCs2WDfcmWdDKNeIziMg49o", auth_payload)


for i in range (1,100):

	spotId = random.randrange(1,127)
	f = Firebase("https://parking-monitor.firebaseio.com/lots/S17", auth_token=token)
	distance = random.randrange(0,400)
	randTime = random.randrange(1435255107,1465265107)
	rp = f.post({"date":randTime, "serial":"HC-SR04-1", "distance":distance, "spot":spotId})
	print("POST: " + str(rp))
	time.sleep(1)
开发者ID:AntonFranzluebbers,项目名称:Parking-Monitor-Firebase,代码行数:21,代码来源:sendRandomData.py


注:本文中的firebase.Firebase.post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。