-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_settings.py
33 lines (30 loc) · 1.47 KB
/
user_settings.py
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
30
31
32
33
## User Settings
## Modifiy values below to get friends images
## fb_uif : Your user id on facebook
## fb_access_token : Access token to FB Graph API to Download images
## to local images folder
## Refer : Goto https://developers.facebook.com/tools/explorer/145634995501895
## accept permissions and get your access token ans facebook id to
## the below fields
## images_folder_path : To Download images from FB to generate imagegrid
## agent : User agent to mimic a browser request to FB
## to get images without hassels
import os
PATH = lambda root, *a: os.path.join(root, *a)
ROOT = os.path.dirname(os.path.abspath(__file__))
IMAGES_ROOT = PATH(ROOT, 'images/')
class User:
def __init__(self):
## This can be ignored, :)
if(os.path.isfile(PATH(ROOT, 'dev_settings.py'))):
import dev_settings
self.fb_uid = dev_settings.FB_UID
self.fb_access_token = dev_settings.FB_ACCESS_TOKEN
else:
## To be adjusted by user
self.fb_uid = "YOUR_FB_ID"
self.fb_access_token = "YOUR_FB_ACCESS_TOKEN"
#You need not modify anything below this line.
self.agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31"
self.images_folder_path=IMAGES_ROOT
self.root_folder_path=PATH(ROOT, '')