Git Product home page Git Product logo

farcaster-followers-frame's Introduction

farcaster-followers-frame

Try it in warpcast

How does it work?

  • user clicks on the get my data button
  • the app receives a POST to /followers with the fid of the user
  • we hit the gRPC API of a Farcaster hub and makes a LinksByTargetRequest with the user's fid
  • we receive a list of messages and increment the follower count for every MESSAGE_TYPE_LINK_ADD and decrement it for every MESSAGE_TYPE_LINK_REMOVE
  • we create a pandas.Series object using the timestamp of the messages and the follower count
  • we plot the series using seaborn/matplotlib
  • we render the graph as a png and return it

GRPC API

# separately check out hub-monorepo
git clone https://github.com/farcasterxyz/hub-monorepo path/to/hub-monorepo

# copy the updated protobufs in our repo
cp -R path/to/hub-monorepo/protobufs farcaster-followers-frame/protobufs

# generate the client code
python -m grpc_tools.protoc -I./protobufs/schemas/ \
  --python_out=./src/fff/grpc --grpc_python_out=./src/fff/grpc protobufs/schemas/*.proto

# fix the darn imports generated by protoc
rye run protol --in-place --python-out src/fff/grpc protoc --proto-path=protobufs/schemas protobufs/schemas/*.proto

To configure the RPC host, create a .env file and point it at your hub gRPC host and port:

HUB_RPC=hostname:2283

farcaster-followers-frame's People

Contributors

karmacoma-eth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.