コード例 #1
0
ファイル: profiles.py プロジェクト: vtemian/buffpy
from buffpy.api import API
from buffpy.managers.profiles import Profiles


# check http://bufferapp.com/developers/apps to retrieve a token
# or generate one with the example
token = "awesome_token"

# instantiate the api object
api = API(client_id="client_id",
          client_secret="client_secret",
          access_token=token)

# get all profiles
profiles = Profiles(api=api)
print(profiles.all())

# filter profiles using some criteria
profile = Profiles(api=api).filter(service="twitter")[0]
print(profile)

# get schedules of my twitter profile
profile = Profiles(api=api).filter(service="twitter")[0]
print(profile.schedules)

# update schedules times for my twitter profile
profile = Profiles(api=api).filter(service="twitter")[0]

profile.schedules = {
    "days": ["tue", "thu"],
    "times": ["13:45"]
コード例 #2
0
ファイル: profiles.py プロジェクト: talpor/buffpy
from buffpy.managers.profiles import Profiles
from buffpy.api import API

# check http://bufferapp.com/developers/apps to retrieve a token
# or generate one with the example
token = 'awesome_token'

# instantiate the api object
api = API(client_id='client_id',
          client_secret='client_secret',
          access_token=token)

# get all profiles
profiles = Profiles(api=api)
print profiles.all()

# filter profiles using some criteria
profile = Profiles(api=api).filter(service='twitter')[0]
print profile

# get schedules of my twitter profile
profile = Profiles(api=api).filter(service='twitter')[0]
print profile.schedules

# update schedules times for my twitter profile
profile = Profiles(api=api).filter(service='twitter')[0]

profile.schedules = {
  'days': ['tue', 'thu'],
  'times': ['13:45']
コード例 #3
0
ファイル: profiles.py プロジェクト: ishandutta2007/buffpy
from colorama import Fore

from buffpy.api import API
from buffpy.managers.profiles import Profiles

# check http://bufferapp.com/developers/apps to retrieve a token
# or generate one with the example
token = "awesome_token"

# instantiate the api object
api = API(client_id="client_id",
          client_secret="client_secret",
          access_token=token)

# get all profiles
profiles = Profiles(api=api)
print(profiles.all())

# filter profiles using some criteria
profile = Profiles(api=api).filter(service="twitter")[0]
print(profile)

# get schedules of my twitter profile
profile = Profiles(api=api).filter(service="twitter")[0]
print(profile.schedules)

# update schedules times for my twitter profile
profile = Profiles(api=api).filter(service="twitter")[0]

profile.schedules = {"days": ["tue", "thu"], "times": ["13:45"]}