Skip to content

Instantly share code, notes, and snippets.

View impshum's full-sized avatar
:octocat:
Loading...

impshum

:octocat:
Loading...
View GitHub Profile
from bs4 import BeautifulSoup
from requests import get
from fake_useragent import UserAgent
import csv
max_pages = 2
products_per_page = 100
min_price = 10
max_price = 100
from bs4 import BeautifulSoup
from requests import get
import csv
def main(query, max_pages, outfile):
query = query.replace(' ', '%20')
page = 1
next = True
with open(outfile, 'w+') as csv_file:
import configparser
import praw
import pickledb
import time
import sys
from requests import get
import datetime
ignore = ['-en-', 'trite_username', '0imp', '1uvx', '--og', 'Mr_E']
[TWITTER]
twitter_consumer_key = XXXX
twitter_consumer_secret = XXXX
twitter_access_token = XXXX
twitter_access_token_secret = XXXX
@impshum
impshum / changer.py
Last active March 14, 2020 11:55
Change colour of screen thingy with pywebview
import webview
class Api:
def __init__(self):
self.recording = False
def record(self):
if not self.recording:
self.recording = True
@impshum
impshum / return_user_input_from_dict.py
Last active March 14, 2020 13:09
Return user input from dictionary
things = {
'1': 'one',
'2': 'two',
'3': 'three',
'0': 'EXIT'
}
def menu(options, menu_text):
while 1:
for k, v in options.items():
@impshum
impshum / reddit_autovote_all.js
Created June 12, 2020 21:50
Automagically Up/downvote all on page | Reddit
// OPEN JS CONSOLE THEN
// UPVOTE
$('.up').click();
// DOWNVOTE
$('.down').click();
// P.S. NOT RECOMMENDED
from bs4 import BeautifulSoup
import requests
import urllib.parse
import pandas as pd
import json
import csv
def build_query(a, b):
a = a.replace(' ', '+')
from bs4 import BeautifulSoup
from splinter import Browser
from selenium.webdriver.chrome.options import Options
import csv
categories = [
{'Arbeitsspeicher': {'pages': []}},
{'Capture-Karten': {'pages': []}},
{'PC-Komponenten': {'pages': ['CPUs', 'Festplatten', 'Laufwerke', 'Mainboards']}},
@impshum
impshum / get_headers_footers.py
Created August 10, 2021 17:12
An attempt to grab selected elements from pages (fuck that: just build it).
from bs4 import BeautifulSoup
import requests
import cssutils
import logging
cssutils.log.setLevel(logging.FATAL)
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1'}
base_url = 'http://localhost:8888/bulma-start/'