-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfb_group.py
More file actions
24 lines (21 loc) · 850 Bytes
/
Copy pathfb_group.py
File metadata and controls
24 lines (21 loc) · 850 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
#!/usr/bin/env python
# from bs4 import BeautifulSoup
import requests
import json
from pyfacebook import GraphAPI
def read_creds(filename):
'''
Store API credentials in a safe place.
If you use Git, make sure to add the file to .gitignore
'''
with open(filename) as f:
credentials = json.load(f)
return credentials
credentials = read_creds('credentials.json')
graph = GraphAPI(access_token=credentials['access_token'])
data=[]
# with open("data.txt", "r") as post:
# data=post.readlines()
# for post in data:
# graph.post_object(object_id="group id", connection="photos",data={"message": "#hacker #hacking","link":})
graph.post_object(object_id="1481356368863712", connection="photos",data={"caption":"#hacker", "message":"Posted by python", "url":"https://wallpaperaccess.com/full/6866658.png"})