Skip to content

Instantly share code, notes, and snippets.

View mavx's full-sized avatar

Au Yong Min Hao mavx

View GitHub Profile
@mavx
mavx / openSeaApi.gs
Last active August 29, 2021 04:10
Google Sheet functions that call OpenSea stuff
function getOsImageUrl(contractAddress, tokenId) {
let assetUrl = `https://api.opensea.io/api/v1/asset/${contractAddress}/${tokenId}`
let jsonResp = JSON.parse(request(assetUrl))
return jsonResp["image_thumbnail_url"]
}
function openSeaHighestBid(contractAddress, tokenId) {
let assetUrl = `https://api.opensea.io/api/v1/asset/${contractAddress}/${tokenId}`
try {
let jsonResp = JSON.parse(request(assetUrl))
@mavx
mavx / main.py
Last active August 28, 2021 12:51
Sample Python aiohttp code
import aiohttp
import asyncio
from aiohttp import ClientSession
async def get_pokemon(session: ClientSession, url: str):
async with session.get(url) as resp:
pokemon = await resp.json()
return pokemon["name"]