Skip to content

Instantly share code, notes, and snippets.

try:
from steamworks import STEAMWORKS
from requests import *
# Declare the steamworks variable and create a new instance of the Steamworks class
steamworks = STEAMWORKS()
# Initialize Steam
steamworks.initialize()
@itsJlot
itsJlot / wikipedia_scraper_netx.py
Created August 1, 2019 00:10
Wikipedia Scraper with networkX graphing, faster setup than neo4j version
import requests, bs4 as bs, time as t,re,networkx as nx,matplotlib.pyplot as plot
graph = nx.Graph()
def getBSoupFromLink(link):
return bs.BeautifulSoup(requests.get(link).text,"html.parser")
for x in range(10):
curLink = "/wiki/Special:Random"
startingTitle = "Random"
for x in range(5):
startingLink = curLink
bsoup = getBSoupFromLink("https://en.wikipedia.org"+curLink)
@itsJlot
itsJlot / wikipedia_scraper.py
Created August 1, 2019 00:00
Wikipedia scraper with Neo4J Graph
import requests, bs4 as bs, time as t,re,matplotlib.pyplot as plot,py2neo as neo
graph = nx.Graph()
neograph = neo.Graph("bolt://localhost:7687",auth=("neo4j","neo4jpass"))
matcher = neo.NodeMatcher(neograph)
randomNode = matcher.match("Article", name="Random").first()
if not randomNode:
randomNode = neo.Node("Article", name="Random")
neograph.create(randomNode)
def getBSoupFromLink(link):
return bs.BeautifulSoup(requests.get(link).text,"html.parser")
import discord
import asyncio
import time as t
import random as r
client = discord.Client()
class Data:
def __init__(self):
self.reactions = {}
d = Data()
@client.event
@itsJlot
itsJlot / db.json
Last active June 7, 2017 21:28
Quick notes, allows for users to create and read notes in cmd help in application for help. Made using python3
{"help" : "Add a note by typing in one or more keywords, this is the 'tag' that you can use to find it.\nremove a note by putting a '/' in front, feel free to try it on deleteme right now, using '/deleteme'\nsearch for a note or just get its content using '?', when you specify a note it will return either nothing, indicating that it does not exist or the note you saved using that tag.\n you can also put a regex after the '?' to find all notetags that match that desciption.",
"deleteme" : "The help told you to delete me? Sure, go ahead, end my life. You dont have to feel bad."}
@itsJlot
itsJlot / cmdiscord.py
Last active June 18, 2017 17:18
Minimal version of discord running in Commandline. Potentially useful for weak pcs or machines with operating systems without GUI support. requires discord.py and python3
# -*- coding: utf-8 -*-
import discord
import getpass, sys,re, datetime, time as t
cmds = {"help" : "help()","servers" : "list_servers()", "logout" : "break",
"send" : "send_message()", "chat" : "choose_chat()"}
cmds_no_param = {"help" : "help()","servers" : "listServers()", "logout" : "break" }
client = discord.Client()
def millisecs():
return int((datetime.datetime.utcnow() - datetime.datetime(1970, 1, 1)).total_seconds() * 1000)