Revision: 9188
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 25, 2008 01:28 by matthewnovak
Initial Code
# mechanize handles cookies, so we can actually log in import mechanize USERNAME = '' PASSWORD = '' RSS_URL = '' # Instantiate the mechanize browser br = mechanize.Browser() # Add headers to make the "browser" look real br.addheaders = [("User-agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3"), ("HTTP_CONNECTION", "keep-alive"), ("HTTP_KEEP_ALIVE", "300"), ("HTTP_ACCEPT", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"), ("HTTP_ACCEPT_CHARSET", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"), ("HTTP_ACCEPT_ENCODING", "gzip,deflate"), ("HTTP_ACCEPT_LANGUAGE", "en-us,en;q=0.5"), ("HTTP_USER_AGENT", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3")] # We're not a robot br.set_handle_robots(False) # Navigate to the login page br.open('''http://rss2.com/signin/''') # Count the forms in the HTML, we want the 1st one br.select_form(nr=0) # Fill in the form elements by name br["username"] = USERNAME br["password"] = PASSWORD # Click the submit button login_response = br.submit() # Read the login buffer, might want to actually do something with this buffer = login_response.read() # Navigate to your user's page br.open('''http://rss2.com/users/%s''' % (USERNAME)) # Count the forms in the HTML, we want the 1st one br.select_form(nr=0) # Fill in the form elements by name br["site_url"] = RSS_URL # Click the submit button resp = br.submit() # View the results after the click print resp.read()
Initial URL
http://blackcodeseo.com/automating-rss-submissionautomating-rss-submission/
Initial Description
Log in to feedage.com Submit an rss feed Print the results
Initial Title
Submit To Feedage
Initial Tags
python
Initial Language
Python