Skip to content

Conversation

@r3shabh
Copy link

@r3shabh r3shabh commented Oct 26, 2017

import httplib, urllib 
from bs4 import BeautifulSoup 
import os 
import json
import time
#Insert the access_token here 
access_token=''
conn = httplib.HTTPSConnection("graph.facebook.com") 
print 'requesting...'
 
 
def comment(url): 
    connect = httplib.HTTPSConnection("graph.facebook.com") 
    connect.request("GET",url) 
    
    for x in xrange(2):         
            
            print 'commenting %d '% x
            path ='/'+'324099411057983'+'/comments'
            param_data={  'format':'json', 
                        'message':'I don\'t know what to comment.', 
                        'access_token':access_token 
                  } 
            connect = httplib.HTTPSConnection("graph.facebook.com") 
            connect.request("POST",path,urllib.urlencode(param_data),{}) 
            #res = connect.getresponse()
            #added sleep to delay commenting , seem human.
            time.sleep(0.09)
#324099411057983 is the post id. You can see in the url of the post.            
url='/324099411057983'
comment(url) 
print 'finished :)'

Copy link
Contributor

@divyanshu-rawat divyanshu-rawat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you have copied this script from somewhere :)

Copy link

@yashovardhan yashovardhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel you have committed anything, and also your remote is wrongly set.
Commenting script that too copied in the description is not a way to commit and send PR.
First, learn the proper way and then try to do things rather than spamming the repository.

Person Incharge of this repository will close this PR if he feels so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.