Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stephancill/subjective-farcaster
Get reaction and follow counts based on an FID's wider network
https://github.com/stephancill/subjective-farcaster
Last synced: 13 days ago
JSON representation
Get reaction and follow counts based on an FID's wider network
- Host: GitHub
- URL: https://github.com/stephancill/subjective-farcaster
- Owner: stephancill
- Created: 2024-06-16T17:34:27.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-21T23:23:00.000Z (5 months ago)
- Last Synced: 2024-06-23T10:13:37.330Z (5 months ago)
- Language: TypeScript
- Homepage: https://subjective-farcaster.steer.fun
- Size: 507 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Subjective Farcaster Metrics
This is a collection of cached endpoints which can be used to calculate the number of likes on a cast or the number of followers of a user filtered based on 2 degrees of separation from the viewer i.e. only counting interactions from the viewer's follows or the follows of the viewer's follows.
## Endpoints
- `GET /cast?fid=&hash=&viewerFid=` - Returns the number of likes on a cast
Sample
```
GET /cast?fid=1689&hash=0x5201d906379adb1265bd5bb9a38ef09fd37f0972&viewerFid=1689
``````
{
"allLinksCount": 47369,
"intersectionCount": 24,
"intersectionByDepth": {
"0": 11,
"1": 13
},
"linksByDepthCounts": {
"0": 883,
"1": 46486
}
}
```- `GET /user?fid=&viewerFid=` - Returns the number of followers of a user
Sample
```
GET /followers?fid=3&viewerFid=1689
``````
{
"allLinksCount": 47369,
"intersectionCount": 40382,
"intersectionByDepth": {
"0": 804,
"1": 39578
},
"linksByDepthCounts": {
"0": 883,
"1": 46486
}
}
```## Development
Copy the `.env.sample` file to `.env` and fill in the required values.
```
cp .env.sample .env
``````
yarn install
``````
yarn start
```