Skip to content

Instantly share code, notes, and snippets.

View sauravtom's full-sized avatar
Working from home

Saurav Kumar sauravtom

Working from home
View GitHub Profile
sauravtom /
Created February 19, 2014 19:06
Source code for news orchin blog bot
from gdata import service
import gdata
import atom
import getopt
import sys
from local_settings import email,password,blogid
import requests
import requests
domains = domain.split(" ")
def main(domain):
url = ""%domain
f = requests.get(url)
sum = 0
for i in f.json()['Values']:
def remove_tags(s):
for i in range(len(s)):
if len(p)!=0 :
for e in range(0,len(li)-1,1):
def do_it(x,y,z):
# To Do : for x in z: replace x by y,again and again
# 1st step: if x appears in z
# 2nd step: then replce x by y
for i in range(len(z)-3):
if z[i:i+3]==x: # I cannot understand why this is not working , I set
z=z[:i]+y+z[i+3:] # the condition that if x is in z then modify z as follows
i=0 # and then I set i as 0 , and go over the loop again,
sauravtom / Annoy.bat
Created June 7, 2012 04:39
Simple batch file program that displays a list of messages and then goes to loop.
@echo off
title Ok so get ready to be annoyed,
msg * Hello %username%, I am Saurav
msg * How are you %username%?
msg * I am fine.
msg * .......
msg * this is a whale , '____________________________'
msg * I hope this annoying string of messages finds you in the best of your health.
msg * Since this is one way conversation, almost all of the talking will be done by me only.
sauravtom / app.yaml
Created June 26, 2012 15:04
import webapp2
form = """
<form title="Google Something" align = "center" action = "" target="_blank">
<input name = "q"> <input type = "submit" value="Google search">
<form title="Search something on Duck Duck go" align = "center" action = "" target="_blank">
<input name = "q"> <input type = "submit" value="DuckDuckGo search">
Verifying that +sauravtom is my blockchain ID.
sauravtom / url.html
Created December 31, 2012 10:21
url database
<title>Firebase Chat Example</title>
<script type="text/javascript" src=""></script>
<script type='text/javascript' src=''></script>
<input type='text' id='nameInput' placeholder="Your Url">
mkdir my_new_project
cd my_new_project
git init
git checkout --orphan gh-pages
touch index.html
gedit index.html //open index.html and edit the homepage
git add .
git commit -a -m 'First Version'
git remote add origin<username>/<projectname>.git
sauravtom /
Created January 10, 2013 07:51
Fetch tweet of a given username in command line
import urllib2
import json
def get_tweets(name):
s = urllib2.urlopen(""+name).read()
x = json.loads(s)
for i in range(len(x['results'])):
print "%s.%s--> %s\n" %(i, x['results'][i]['from_user_name'], x['results'][i]['text'])
name = raw_input("Enter the twitter-username get recent tweets: ")