LinkedIn API: get r_basicprofile using URL/vanityName - python

I'm new to LinkedIn API.
Is there any way to retrieve r_basicprofile using v1 API?
I'm using Python and my GET url is:
'https://api.linkedin.com/v1/people/~?url=%s&oauth2_access_token=%s&format=json' %(v_member_url,v_access_token)
I get only my profile no matter what I put in v_member_url.

https://api.linkedin.com/v1/people/%s&oauth2_access_token=%s&format=json' %(v_member_url,v_access_token)
try this
the ~ symbol stands for yourself.
this should be replaced with the personID
https://api.linkedin.com/v1/people/[PERSONID]&oauth2_access_token=[TOKEN]&format=json

Related

How to get company official website url from company name using python?

I've tried clearbit's api. But it doesn't give me many company's website url. Is there any other way to do it? One of the companies whose url this api cannot find is 'Acute Leukemia French Association'. My code is as follows:
response = requests.get('https://autocomplete.clearbit.com/v1/companies/suggest?query={Acute Leukemia French Association}')
Output: []
I have used this earlier for similar implementations. Try this: Crunchbase API
Also, check some of other related APIs Other APIs
You can try fetching Crunchbase data from the following API, it has a bit of latency but is pretty accurate-
https://rapidapi.com/shake-chillies-shake-chillies-default/api/crunchbase4

vimeo api python using keywords to search for videos

I'm trying to use the Vimeo API with Python, but I'm stuck trying to find video's using keywords.
What I have is this, after successfully registering with Vimeo:
import vimeo
client = vimeo.VimeoClient(
token='my_token',
key='my_key',
secret='my_secret_key'
)
about_me = client.get('/me',params={'fields':'uri,name'})
json.loads(about_me.text)
these return my user credentials. Now I want to use a similar approach to get videos using Query keywords, like on their page. But I cannot get it to work.
So, I want to have a JSON returned with movies based on keywords (like 'interstellar trailer' and not the URI or id of Vimeo).
But for some reason, I can't get the query keyword to work, and from the linked page above, I cannot figure it out how to implement it in my code.
27-02-19: UPDATE: I figured it out, and will update my solution here, soon.
The /me endpoint only returns the user object for the authenticated user.
To get and search for videos, use the /me/videos or /videos endpoint (depending on if you are searching for videos on your own account, or searching for videos from other users public on Vimeo).

get additional info from facebook-sdk using python

I am using python to get info data from facebook api.
I use the following code:
import facebook
import requests
token = 'mytoken'
graph = facebook.GraphAPI(token)
profile=graph.get_object("me")
but only the name and the id are returned. Thus i cannot use the command
profile["gender"]
in order to get the user's gender.
How can i fix that?
thank you!!

Gmail authentication

I want to make authentication on Gmail, using Grab (Python library).
from grab import Grab
g = Grab()
g.go('https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1&osid=1')
g.doc.set_input("Email","*****#gmail.com")
g.doc.set_input("Passwd","*********")
g.doc.submit(submit_name = 'signIn')
print g.doc.select("//title").text()
And this code display 'Gmail', but it must print: 'Вхідні - email_name#gmail.com - Gmail', isn`t it?
What am I doing wrong?
Attempting to automate Gmail logins like this will frequently get tripped up by Google's anti-bot techniques, like captchas.
Gmail has an API you should use instead
https://developers.google.com/gmail/oauth_overview
https://developers.google.com/gmail/api/

Get latest Instagram user photos using python-instagram library

I am using python-instagram api in my application in order to fetch recent photos from my instagram account. I am using following approach but couldn't succeed:
from instagram.client import InstagramAPI
api = InstagramAPI(client_id='MY_CLIENT_ID', client_secret='MY_CLIENT_SECRET')
recent_media= api.user_recent_media(my_user_id, 6, max_id)
for media in recent_media:
print media.images['standard_resolution'].url
endfor
Here I don't understand what max_id parameter is. I have tried ignoring max_id, but it doesn't work. I have tried to get popula media, and it worked:
popular_media = api.media_popular(count=6)
Can anyone give me some idea? I am a PHP programmer and kinda new in python. All I need is - to get my recent instagram photos (6 of them) and show them in web page with an url so that user can click them. Do I need use access token for this? I hope not. Because I don't have any experience with python API yet.
Try to authenticate your api first, this can be the case. You do not necessarily have access to user recent media otherwise
Use named arguments in this case to be sure.
api.user_recent_media(user_id=user_id, count=10)
Max_id is optional and specifies, that you want to see photos with smaller id's.
(e.g res=5,4,3,2,1 with max_id = 3 res=3,2,1)

Categories

Resources