Skip to content

Instantly share code, notes, and snippets.

View renjithsraj's full-sized avatar
:shipit:

Renjith S Raj renjithsraj

:shipit:
View GitHub Profile
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@renjithsraj
renjithsraj / siteworking.py
Created September 17, 2015 09:14
Python Script for whether the given website us down or not if the site is down , script will send the mail to the corresponding admin email , internet need for sending email
from threading import Thread
import requests ## pip install requests
import time
import smtplib
## email sending function
def email_sender(input_message, email_to, client):
''' function to send email '''
to = email_to
gmail_user = '' ## email of sender account
@renjithsraj
renjithsraj / selenim_scrapping.py
Last active May 9, 2020 19:30
In this code you’ll learn to use Selenium with Python, a Web Scraping tool that simulates a user surfing the Internet. For example, you can cial accounts, simulate a user to test your web application, and anything you find in your daily live that it’s repetitive. The possibilities are infinite! :-) Here my example code for scrap the data from th…
from selenium import webdriver
import time
import os
import datetime as dt
from BeautifulSoup import BeautifulSoup
from pyvirtualdisplay import Display
import json
import sys,getopt
import datetime
chromedriver = "/usr/bin/chromedriver"
@renjithsraj
renjithsraj / payu.py
Last active September 23, 2016 07:07
models.py
from django.db import models
from uuid import uuid4
from uuid import UUID
import uuid
from django_extensions.db.fields import UUIDField
Sample Integration payU in django based projects
Settings.py
PAYU_INFO = {
'merchant_key': "test merchant key",
from threading import Thread
import requests ## pip install requests
import time
import smtplib
## email sending function
def email_sender(input_message, email_to):
''' function to send email '''
to = email_to
gmail_user = 'your email'
from django.contrib.auth.models import User
class Artist(User):
name = models.CharField(max_length=120, verbose_name='name')
class Followers(models.Model):
artist = models.ForeignKey(Artist, related_name='following')
follower = models.ForeignKey(Artist, related_name='followers')
date_created = models.DateTimeField(auto_now_add=True, verbose_name='Date Created')
date_updated = models.DateTimeField(null=True, blank=True)
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.auth.models import AbstractUser
from django.db import models
GENDER = (('F','Female'),('M','Male'))
# Create your models here.
class Proffession(models.Model):
@renjithsraj
renjithsraj / gist:de508b5c88e5ad14445f3ec2d12a9a27
Created July 28, 2017 05:00
Createing Virtualenv with PIP3
Create Virtualenv with Python3
==============================
1. mkvirtualenv --python=/usr/local/bin/python3 multichat
2. workon multichat
3. pip3 install ipython
$(document).ready(function(){
$("#your-dropdown-id").change(function(){
var drid = $(this).val();
$.ajax({
url: 'getUsers.php',
type: 'post',
data: {value:drid},
dataType: 'json',
success:function(response){
// add the json response into html values