-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfbs.py
More file actions
29 lines (25 loc) · 709 Bytes
/
fbs.py
File metadata and controls
29 lines (25 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json, urllib, webbrowser
def get_profile_id(username):
"""
Input : Username
Output : Profile Id
"""
url = "http://graph.facebook.com/" + username
response = urllib.urlopen(url)
data = json.loads(response.read())
return data['id']
def open_image_page(profile_id):
"""
Input : Profile Id
Output : Opens a new tab with graph search results
"""
new_url = "https://www.facebook.com/search/"+profile_id+"/photos-of"
webbrowser.open_new_tab(new_url)
def main():
username = raw_input("Enter the Username : ")
user_id = get_profile_id(username)
open_image_page(user_id)
print ""
return 0
if __name__ == '__main__':
main()