Skip to content

Instantly share code, notes, and snippets.

Avatar

ries9112

View GitHub Profile
@ries9112
ries9112 / CV_TheGraph_delegation_pull.R
Created May 16, 2022
A script that makes an API request using the users's address to make a plot of the user's delegation on The Graph
View CV_TheGraph_delegation_pull.R
let image_show = parcel.getFeatureById('image_show_delegation')
feature.on('click',e=>{
image_show.set({'url':"http://r-cv-api.org/delegation/delegations_unrealized_rewards?delegator="+e.player.wallet})
console.log(e.player.wallet)
})
View delegator_charts.R
library(ghql)
library(jsonlite)
library(tidyverse)
# connect to endpoint
con = GraphqlClient$new(
url = "https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-analytics"
)
# initialize a new query
graphql_request = Query$new()
@ries9112
ries9112 / CV_arweave_backups.yml
Created Mar 13, 2022
Script to automate upload of CV parcel content to arweave
View CV_arweave_backups.yml
name: Automated Backups Cryptovoxels
on:
schedule:
- cron: '0 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ries9112
ries9112 / flexdashboard_hicdex_lookup
Created Sep 5, 2021
A dashboard to plot cumulative sales over time for either an artist or a given tag: https://predictcrypto.shinyapps.io/HEN_lookup/
View flexdashboard_hicdex_lookup
---
title: "HEN Data Lookup"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
theme: spacelab
source_code: embed
social: ['twitter','facebook','linkedin']
runtime: shiny
@ries9112
ries9112 / plot_by_artist.R
Created Sep 5, 2021
Plot cumulative sales in Tezos for your favorite HEN artist
View plot_by_artist.R
library(ghql)
library(jsonlite)
library(tidyverse)
library(ggdark)
library(ggfx)
library(scales)
# Tag to lookup:
artist = "tz2Pkj2xWJovKKCsABjnr3NbyMVJTMBkpTvb"
@ries9112
ries9112 / Plot objkt4objkt tag sales - HEN
Last active Sep 5, 2021
You can run this code at any time to view the cumulative sales over time of objkts with the "objkt4objkt" tag
View Plot objkt4objkt tag sales - HEN
library(ghql)
library(jsonlite)
library(tidyverse)
library(ggdark)
library(ggfx)
library(scales)
# Tag to lookup:
tag = "objkt4objkt"
@ries9112
ries9112 / CV_API_pull.R
Created Aug 22, 2021
R script that pulls all data for CV parcels, then collects data about their prices using opensea API
View CV_API_pull.R
# https://wiki.cryptovoxels.com/en/External-API
# Pull data from opensea using vox tokenIDs pulled in grt_vox_pull_tokenID.R
library(jsonlite)
library(httr)
library(tidyverse)
# example
url <- 'https://www.cryptovoxels.com/api/parcels.json'
# Get the data from the url
@ries9112
ries9112 / CV_archive_tx_id
Last active Jul 23, 2021
Query to find CryptoVoxels Archives. Copy/paste into https://arweave.net/graphql
View CV_archive_tx_id
query {
transactions(
tags: [
{
name: "Content-Type",
values: ["application/zip"]
},
{
name: "Tag-Name",
values: ["CryptoVoxelsArchive"]
@ries9112
ries9112 / CV_backup.yml
Created Jul 15, 2021
arweave CV backups GithubActions
View CV_backup.yml
name: Automated Backups Cryptovoxels
on:
schedule:
- cron: '0 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ries9112
ries9112 / CV_pull_recent_audio_objkts
Created Jun 30, 2021
This is Ricky's CV script of the gallery that displays the most recent artwork from hic et nunc (https://www.cryptovoxels.com/play?coords=SE@6922W,34S). This is an adaptation where the GraphQL query returns data for audio objkts (as requested by @Mighty_33)
View CV_pull_recent_audio_objkts
feature.on('click',e=>{
fetch('https://api.hicdex.com/v1/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: `
query MyQuery {