8000 link_encoders_by_count by log10 · Pull Request #35 · bitly/bitly-api-python · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

link_encoders_by_count #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bitly_api.py
as per bitly api documentation there should be optional parameters 'login' and 'full_name' for getting information about particular user, so modified user_info method

method link_encoders_by_count is missing. hence I added it
  • Loading branch information
log10 committed Jun 3, 2015
commit c4a0ca9d923705f8f06204e7428d28897c8ace7d
20 changes: 17 additions & 3 deletions bitly_api/bitly_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ def link_encoders_count(self, link, **kwargs):
data = self._call(self.host, 'v3/link/encoders_count', params,
**kwargs)
return data['data']


def link_encoders_by_count(self,link,**kwargs):
"""return the ecoders along the click counts"""
params=dict(link=link)
data = self._call(self.host,'v3/link/encoders_by_count',params,**kwargs)
return data['data']

def link_referring_domains(self, link, **kwargs):
"""
returns the domains that are referring traffic to a single bitly link
Expand Down Expand Up @@ -323,9 +329,17 @@ def user_tracking_domain_shorten_counts(self, domain, **kwargs):
"v3/user/tracking_domain_shorten_counts", params, **kwargs)
return data["tracking_domain_shorten_counts"]

def user_info(self, **kwargs):
def user_info(self, login=None,full_name=None,**kwargs):
"""return or update info about a user"""
data = self._call_oauth2("v3/user/info", kwargs)
data=None
if login is not None and full_name is not None:
data = self._call_oauth2_metrics("v3/user/info", dict(login=login,full_name=full_name), **kwargs)
elif login is not None:
data = self._call_oauth2_metrics("v3/user/info", dict(login=login), **kwargs)
elif full_name is not None:
data = self._call_oauth2_metrics("v3/user/info", dict(full_name=full_name), **kwargs)
else:
data = self._call_oauth2_metrics("v3/user/info", dict(), **kwargs)
return data

def user_link_history(self, created_before=None, created_after=None,
Expand Down
0