Skip to content

Instantly share code, notes, and snippets.

View rvvvt's full-sized avatar
💭
hail, traveler.

rvvvt rvvvt

💭
hail, traveler.
View GitHub Profile
@rvvvt
rvvvt / vk_ip_async.py
Created February 25, 2019 15:11 — forked from colyk/vk_ip_async.py
async
import requests
import asyncio
from bs4 import BeautifulSoup
proxy_list = []
def get_html(URL):
r = requests.get(URL)
# print(r.request.headers)
if(r.status_code == 200):
@rvvvt
rvvvt / list_remove_duplicates.py
Created February 20, 2019 15:44
A quick way to remove duplicates from a Python list. Super easy!
the_list = ['a','a','b','b','c','c']
for each in the_list:
# prints our list with duplicates of course
print(each)
newlist=[ii for n,ii in enumerate(the_list) if ii not in the_list[:n]]
for each in newlist:
# and just like that - newlist has no duplicates!
print(each)
@rvvvt
rvvvt / dirty-igdl.py
Last active May 19, 2019 16:57
Dirty lil instagram image scraper - downloads images by tag name. Aw yis.
import re
import requests
tag = 'mpower'
r = requests.get('http://www.instagram.com/explore/tags/' + tag + '/')
html = r.text
# print(html)
img = re.compile('(?:\"display_url\":\")([^\"]+)\"')
@rvvvt
rvvvt / requests.py
Created January 26, 2019 22:39 — forked from Chairo/requests.py
requests mutil-threading
# -*- coding:utf-8 -*-
import requests
from time import sleep
from threading import Thread
UPDATE_INTERVAL = 0.01
class URLThread(Thread):
def __init__(self, url, timeout=10, allow_redirects=True):
super(URLThread, self).__init__()
@rvvvt
rvvvt / cdh-scrape.py
Created January 26, 2019 09:22 — forked from meg-codes/cdh-scrape.py
A basic web-scrape script designed to look for bad links on a particular site
#!/usr/bin/env python
# Script to scrape all links from a site, compile counts of each link, status
# codes of access and output the results as a CSV
#
# There's absolutely no reason this shouldn't be pulled into an OOP paradigm
# per se, but I left it functionalized because that can be easier for multitasking.
#
# Requirements:
# requests, bs4
@rvvvt
rvvvt / google_search_bs.py
Created January 18, 2019 15:54 — forked from yxlao/google_search_bs.py
Google search with BeautifulSoup
import requests
from bs4 import BeautifulSoup
search_url_prefix = "https://www.google.com/search?q="
def get_first_result(search_str):
search_url = search_url_prefix + search_str
r = requests.get(search_url)
soup = BeautifulSoup(r.text, "html.parser")
return soup.find('cite').text
@rvvvt
rvvvt / searx
Created January 18, 2019 07:19
import requests
import json
import csv
ENGINE_URL = "https://searx.me/?q=%s&format=json"
def loop():
with open('firstten.csv', 'r') as a:
reader = csv.reader(a, lineterminator='\n')
"display_url":"([^"]+)"
@rvvvt
rvvvt / logic.py
Created January 7, 2019 19:41
Python Flask Email Checker
import dns.resolver
import socket
import smtplib
import re
# Set of allowed file extensions
ALLOWED_EXTENSIONS = {'txt', 'csv'}
# Extract all email addresses from a string with a regular expression
var inviter = {} || inviter;
inviter.userList = [];
inviter.className = 'mn-person-card__person-btn-ext button-secondary-medium';
inviter.refresh = function () {
window.scrollTo(0, document.body.scrollHeight);
window.scrollTo(document.body.scrollHeight, 0);
window.scrollTo(0, document.body.scrollHeight);
};