Tag Archives: snippet

Javascript – jQuery – Click Counter

0
Filed under javascript, jquery
Tagged as , , , ,

Author: slac3dork
Site: http://snippet.c0de.me
Summary: Click counter with jQuery framework.

<html>
  <head>
    <title>Twitter like text area</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
    <script type="text/javascript">
      $(function(){
          var total_click = 0;
          $("#clickMe").click(function(){
            total_click = total_click + 1;
            $("#counter").text("Total Click: " + total_click);
return false;
          });
        });
    </script>
  </head>
  <body>
    <form>
      <div id="counter">Total Click: 0</div><br />
    <a id="clickMe" href="#">click me!</a>
  </form>
  </body>
</html>



javascrip,logo,badge,pixel badge

Python – Get Total Subscriber From Feedburner

0
Filed under python
Tagged as , , , , , , , ,

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."



python,logo,banner

Ruby – Simple Port Scanner

0
Filed under ruby
Tagged as , , , , , , , , , ,

Author: slac3dork
Site: http://snippet.c0de.me
Summary: Simple Port Scanner Using Ruby. Tested on Linux. Thanks to someone who’s inspired me to create this script. I forget the name my inspirator, sorry.
Usage: ruby port_scanner.rb <target> <startPort> <endPort>

#!/usb/bin/ruby

#  _________      .__       .____   _______
# /   _____/ ____ |__|_____ |    |  \   _  \    ____
# \_____  \ /    \|  \____ \|    |  /  /_\  \  / ___\
# /        \   |  \  |  |_> >    |__\  \_/   \/ /_/  >
#/_______  /___|  /__|   __/|_______ \_____  /\___  /
#        \/     \/   |__|           \/     \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com
#
require 'socket'
require 'timeout'

class Scanner
  def Scanning(host, startPort, endPort)
    print "\nScanning ", host, "\n"
    for port in startPort..endPort
      begin
        s = TCPSocket.open(host, port)
        Timeout::timeout(1){s}
      rescue
        else
  	print "Port ",port,": Open\n"
  	s.close
      end
    end
  end
end

class Msg
  def hello
    puts "-------------------------------------"
    puts "Simple Port Scanner using Ruby"
    puts "Author: slac3dork"
    puts "I don't know who gives me inspiration to create this script"
    puts "-------------------------------------"
  end
end

if ARGV.length != 3
  puts "\nUsage: ruby port_scanner.rb <target> <startPort> <endPort>"
  exit(1)
end

target = ARGV[0]
startPort = ARGV[1].to_i
endPort = ARGV[2].to_i

host = Scanner.new
host.Scanning(target, startPort, endPort)




ruby,code,code,snippet