Posted by admin on January 30, 2010 – 1:12 pm
Author: slac3dork
Site: http://snippet.c0de.me
Summary: Python script to get total subscriber from Feedburner. Before run this script, Feedburner awareness API must be activated. This is script is inspired by Eric Wendelin.
Usage: python filename.py
#!/usr/bin/python
#
# _________ .__ .____ _______
# / _____/ ____ |__|_____ | | \ _ \ ____
# \_____ \ / \| \____ \| | / /_\ \ / ___\
# / \ | \ | |_> > |__\ \_/ \/ /_/ >
#/_______ /___| /__| __/|_______ \_____ /\___ /
# \/ \/ |__| \/ \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
#!/usr/bin/env python
# IMPORTANT: Feedburner awareness API must be activated
# Replace with your own name
feedburner_name = "c0deme"
import urllib
from xml.dom import minidom
try:
dom = minidom.parse(urllib.urlopen('https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri='+feedburner_name))
entry = dom.getElementsByTagName('entry')[0]
count = entry.getAttribute('circulation')
print "total subscriber:",count
except:
print "Oops! Something went wrong. Check your feedburner's name or your internet connection."

Posted by admin on August 8, 2009 – 3:23 pm
Filed under ruby
Tagged as API, attribute, class, cli, code, command line, command line argument, cURL, cURL like, http, method, net/http, NET::HTTP.post_form, option parse, optparse, rb, ruby, simple, simple cURL, snippet, status, Tweeby, tweet, twitter, twitter API, update, URI.parse
Author: slac3dork
Site: http://snippet.c0de.me
Summary: Tweeby, a cURL alternative only to update twitter status. Just for fun. Tested on Linux.
#!/usb/bin/ruby
# _________ .__ .____ _______
# / _____/ ____ |__|_____ | | \ _ \ ____
# \_____ \ / \| \____ \| | / /_\ \ / ___\
# / \ | \ | |_> > |__\ \_/ \/ /_/ >
#/_______ /___| /__| __/|_______ \_____ /\___ /
# \/ \/ |__| \/ \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
require 'optparse'
require 'net/http'
class Tweeby
def initialize
puts '-------------------------------------------------------'
puts '[+] Tweeby - cURL alternative to update twitter status'
puts '[+] Tweeby.rb - http://snippet.c0de.me'
puts '[+] Author: slac3dork'
puts "-------------------------------------------------------\n\n"
end
def parseOptions
begin
options = {}
opts = OptionParser.new
opts.banner = "Usage: ./tweeby.rb -u your_username -p your_password -s your_status\nExample: ./tweeby.rb -u myuser -p mypassword -s 'this is my status'"
opts.on('-u your_username', '--user your_username', 'your_username = Your Twitter username') do |u|
@username = u
end
opts.on('-p your_password', '--password your_password', 'your_password = Your Twitter password') do |p|
@passwd = p
end
opts.on('-s your_status', '--status your_status', 'your_status = Your Twitter status message') do |s|
@status = s
end
opts.on('-v', '--verbose', 'Run verbosely') do |v|
@verbose = v
end
opts.parse!
if (!(@username and @passwd and @status))
puts opts
exit(1)
end
rescue OptionParser::ParseError
puts opts
exit(1)
end
end
def sendTweet
begin
puts '[+] Starting Tweeby...'
tweet = Net::HTTP.post_form(
URI.parse("http://#{@username}:#{@passwd}@twitter.com/statuses/update.xml"),
{"status"=>"#{@status}"})
if @verbose
puts tweet.body
else
puts '[+] Your status has been updated'
end
puts '[+] Done...'
rescue Exception
puts '[-] Error while tweeting, check your username, password, and internet connection'
end
end
end
# main
twitter = Tweeby.new
twitter.parseOptions
twitter.sendTweet
