Skip to content

Instantly share code, notes, and snippets.

View HH0718's full-sized avatar

James HH0718

  • WA
View GitHub Profile
{
"10000NFTUSDT": {
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"ext_info": "",
"result": [
{
"symbol": "10000NFTUSDT",
"period": "60",
@HH0718
HH0718 / .env
Created November 18, 2022 23:19
Method to find keywords in title and comments of post.
reddit_username=""
password=""
client_id=""
client_secret=""
user_agent="The best thing ever created by me!"
@HH0718
HH0718 / reddit_pushshift.py
Last active November 18, 2022 19:36
A reddit PushShift API call to get total user comments.
import requests
def get_author_total_comments(**kwargs):
r = requests.get("https://api.pushshift.io/reddit/comment/search/", params=kwargs)
data = r.json()
return data['metadata']['total_results']
if __name__ == "__main__":
@HH0718
HH0718 / app.py
Last active February 23, 2021 15:50
from flask import Flask
from flask_restful import Api
from flask_jwt import JWT
from security import authenticate, identity
from resources.user import UserRegister
from resources.item import Item, ItemList
from resources.store import Store, StoreList
app = Flask(__name__)
[CREDENTIALS]
EMAIL = "my.email@gmail.com"
PASSWORD = "MySuperSecretPassword"
[SERVER]
SMTP = "smtp.gmail.com"
PORT = 587
from flask import Flask, request, render_template, jsonify
import sys
app = Flask(__name__)
@app.route('/renewapikey', methods=['POST', 'GET'])
def renew_api_key():
data = (request.form.to_dict())
print(data, sys.stderr)
class MyClass:
def __init__(self, value1, value2):
self.value1 = value1
self.value2= value2
if __name__ == "__main__":
init_class_my_class = MyClass("my_new_value1", "my_new_value2")
print(init_class_my_class.__dict__)