Skip to content

Instantly share code, notes, and snippets.

View chowmean's full-sized avatar
🏠
Working from home

Gaurav Yadav chowmean

🏠
Working from home
View GitHub Profile
@chowmean
chowmean / getyoutubecomment.py
Last active February 4, 2016 20:13
Simple python script to get youtube comments using google api and requests. :D havefun
# Author: chowmean
# simple python script to get the comment of youtube videos using google apis get method
# Date: 21:08:2015
# mail: gaurav.dev.iiitm@gmail.com
# github:github.com/chowmean
#
import oauth2
import time
@chowmean
chowmean / apicalls.php
Last active June 18, 2023 12:00
PHP script to make get and post calls with different parameters using cURL
<?php
#author : chowmean
$data["test_data"]="just testing";
CallAPI("POST","uri",$data,"deviceId","accessToken","application/json","firefox");
@chowmean
chowmean / get_tweets.py
Created August 22, 2015 10:16
Getting tweets using twitter search api and python
#author :chowmean
#github.com/chowmean
#You can make only 180 requests per 15 min.
import oauth2
import time
import urllib2
import json
@chowmean
chowmean / get_ytvideo_details.py
Created August 23, 2015 02:43
Get youtube video details
# Author: chowmean
# simple python script to get the comment of youtube videos using google apis get method
# Date: 23:08:2015
# mail: gaurav.dev.iiitm@gmail.com
# github:github.com/chowmean
#
import oauth2
import time
@chowmean
chowmean / get_product_detail.py
Created August 25, 2015 18:54
Getting details of product from flipkart using api.
import requests
product="MOBE8AHAT4SFH3PJ"
url="https://affiliate-api.flipkart.net/affiliate/product/json?id="
url=url+product
headers = {'Fk-Affiliate-Id': 'affliate_id','Fk-Affiliate-Token':'YOUR token'}
r = requests.get(url, headers=headers)
print r.content
@chowmean
chowmean / image_download_under_proxy
Created December 15, 2015 05:09
Download image under proxy.
import urllib
proxies = {'http': 'http://YOUR_USERNAME:YOURPASSWORD@192.168.1.107:3128','https': 'https://YOUR_USRNAME:YOURPASSOWRD@192.168.1.107:3128'}
res=urllib.urlopen("http://www.py4inf.com/cover.jpg",proxies=proxies)
con=res.read()
outf=open("imgname.jpg",'wb')
outf.write(con)
outf.close()
@chowmean
chowmean / sentiment_classification.py
Created February 4, 2016 05:57 — forked from bonzanini/sentiment_classification.py
Sentiment analysis with scikit-learn
# You need to install scikit-learn:
# sudo pip install scikit-learn
#
# Dataset: Polarity dataset v2.0
# http://www.cs.cornell.edu/people/pabo/movie-review-data/
#
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn
@chowmean
chowmean / runserver.py
Created February 4, 2016 20:11
Simple server listening and responding to all type of requests using SOCKETSERVER Python
import socket
import threading
import SocketServer
import time
import json
import sys
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
@chowmean
chowmean / parent.html
Last active February 4, 2016 20:24
This Javascript snippet is for the parent window to open a child popup window and the child window will return the results to the parent windows after processing. This kind of process is follwed when we have to check login of particular website say A using A's plugin on third party website B. B will call a popup to check for the login and then t…
<html>
<body>
<a href="#/cliceckd"> I am clickec</a>
</body>
<script>
var w = 700;
var h = 480;
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
document.addEventListener('click', function (ev) {
@chowmean
chowmean / login.html
Last active December 21, 2016 09:08
Facebook login and data retrieval using javascript
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Facebook login and receiving Data</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>