Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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

impshum

:octocat:
Loading...
View GitHub Profile
Verifying that +impshum is my blockchain ID. https://onename.com/impshum
@impshum
impshum / .htaccess
Created April 9, 2017 12:07
Force https, enable compression and caching in .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^.*$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
#Gzip
<ifmodule mod_deflate.c>
<ifmodule mod_mime.c>
<?php
# Requires J7mbo's API stuff: https://github.com/J7mbo/twitter-api-php
# REPORT ERRORS
error_reporting(E_ALL);
ini_set('display_errors', 1);
# REPORT ERRORS
# Set timezone
@impshum
impshum / stats.py
Created December 23, 2017 00:39
Get mongodb stats using python with pymongo
from pymongo import MongoClient
try:
client = MongoClient('localhost')
db = client.searchfollow
except:
print("Could not connect to MongoDB")
call = db.command("dbstats")
@impshum
impshum / config.py
Created January 18, 2018 18:59
Get recent images from Reddit and post to Twitter
consumer_key = 'xxxx'
consumer_secret = 'xxxx'
access_key = 'xxxx-xxxx'
access_secret = 'xxxx'
client_id = 'xxxx'
client_secret = 'xxxx'
user_agent = 'New image posts from Reddit to twiiter (by /u/impshum)'
subreddits = ['comics', 'xxxx', 'xxxx']
@impshum
impshum / instauser.py
Created January 23, 2018 20:25
Get self instagram info
from InstagramAPI import InstagramAPI
instauser = ''
instapass= ''
igapi = InstagramAPI(instauser, instapass)
igapi.login()
info = igapi.getSelfUsernameInfo()
woop = igapi.LastJson
@impshum
impshum / markovify.py
Last active February 1, 2018 06:44
Crap markov chain thing
# pip3 install tweepy markovify text_cleaner
# Create the 5 text files mentioned below
# Run - python3 run.py
import markovify
import tweepy
from text_cleaner import keep
from text_cleaner.processor.common import ASCII
from text_cleaner.processor.misc import URL, ESCAPED_WHITESPACE
import re
@impshum
impshum / config.py
Created February 8, 2018 12:21
Tweepy Loops
consumer_key = 'XXXX'
consumer_secret = 'XXXX'
access_key = 'XXXX-XXXX'
access_secret = 'XXXX'
timer = 30
message = 'It works!'
picture = 'path/to/picture.jpg'
@impshum
impshum / stream.py
Created February 8, 2018 21:37
Tweepy Stream Hashtag
import time
import tweepy
import json
import sys
from halo import Halo
target_tag = '#wood'
consumer_key = 'XXXX'
consumer_secret = 'XXXX'
@impshum
impshum / windows_update.py
Created March 3, 2018 14:21
Fake Windows Update
import webview
webview.create_window('Windows Update', url='http://fakeupdate.net/win10/', resizable=True, fullscreen=True, confirm_quit=True)