Skip to content

Instantly share code, notes, and snippets.

View schwittlick's full-sized avatar
🤗
wat

Marcel Schwittlick schwittlick

🤗
wat
View GitHub Profile
import json
import random
import requests
def generate_holders_query(contract: str, token: int) -> str:
return f''' query LatestEvents {{
tokens_by_pk(fa2_address: "{contract}", token_id: "{token}") {{
holdings(where: {{amount: {{_gt: "0"}}}}) {{
@schwittlick
schwittlick / hic_et_nunc_basic_scraper.py
Last active April 17, 2021 07:21 — forked from Quasimondo/hic_et_nunc_basic_scraper.py
This is a very basic no-frills scraper to retrieve the metadata and digital assets from all tokens minted on hicetnunc.xyz. I share this as a starting point for people who want to experiment with building alternative views on the works created on the platform or preserve the data. Feel free to improve upon this or add additional features.
import requests
import os
import ipfsapi
import concurrent.futures
api = ipfsapi.Client(host='https://ipfs.infura.io', port=5001)
url = "https://better-call.dev/v1/contract/mainnet/KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton/tokens"
r = requests.get(url)
// ==UserScript==
// @name KG scraper
// @version 0.1
// @grant none
// ==/UserScript==
function contains(selector, text) {
var elements = document.querySelectorAll(selector);
return Array.prototype.filter.call(elements, function(element){
ASCII_CHARS = [ '#', '?', '%', '.', 'S', '+', '.', '*', ':', ',', '@']
def scale_image(image, new_width=100):
"""Resizes an image preserving the aspect ratio.
"""
(original_width, original_height) = image.size
aspect_ratio = original_height/float(original_width)
new_height = int(aspect_ratio * new_width)
new_image = image.resize((new_width, new_height))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
No.
Why?
Yes.
Lol
Yes
What?
Yes.
Yes
Why?
No.
Lol
No
Wow.
lol
Yep.
Yeah.
Yes.
What?
No.
Why?
@schwittlick
schwittlick / out.txt
Last active June 17, 2017 19:01
TGO V2
lol
Haha
LOL
How?
Why?
Wow.
Sure.
This.
Right?
Same.
Yes
Wow.
Wow.
lol
What?
Yep.
Yeah.
Really?
Thanks!
Thanks!
No.
Yes.
No.
Yes.
No.
Yes.
Yes
Yeah
Yeah
This.