Comments (5)
Yeah, the missing piece of the puzzle is that nginx routes to the API only under the /api/
path. Check it out:
https://opensourcecontributo.rs/api/user/nealmcb
https://opensourcecontributo.rs/api/user/nealmcb/events
etc
from opensourcecontributors.
There already is a simple API, actually. The front end uses it directly. No authentication is necessary. Would you be interested in documenting it?
These are the only endpoints: https://github.com/tenex/opensourcecontributors/blob/master/ghc-app/controller.go#L34
from opensourcecontributors.
Hmm. I tried all those endpoints, and the /user... ones return html, not json. E.g. https://opensourcecontributo.rs/user/nealmcb
The others were just 404 for me. Am I missing something?
from opensourcecontributors.
Indeed - thank you!
I hope to find time to come back to provide proper documentation, but here is an API usage example, in Python, for how to retrieve all events for a user, and hints on sorting them out:
import json
import urllib.request
import codecs
def getevents(userid):
"Retrieve and return all event pages for given userid"
reader = codecs.getreader("utf-8")
events = []
pagenum = 1
while True:
url = "https://opensourcecontributo.rs/api/user/{}/events/{}".format(userid, pagenum)
page = json.load(reader(urllib.request.urlopen(url)))
if page["size"] == 0:
break
events += page["events"]
pagenum += 1
return events
events = getevents("myuserid") # put userid you want in here
events
is now a dict, and the type
field indicates whether it is an IssueCommentEvent
, PushEvent
, IssuesEvent
, GollumEvent
, CommitCommentEvent
, etc.
from opensourcecontributors.
See also:
- statistics: https://opensourcecontributo.rs/api/stats
E.g.{"eventCount":684951818,"latestEvent":"2017-07-13T12:59:59Z","latestEventAge":5631}
- ?? https://opensourcecontributo.rs/api/error
- ?? https://opensourcecontributo.rs/api/aggregates
from opensourcecontributors.
Related Issues (20)
- Use event_id as ID where possible HOT 3
- Upstream prematurely closed connection HOT 2
- Account for nginx in ghc-app logs
- Middleware to filter out misleading panics HOT 1
- Handle errors in which the server is down
- Mobile rendering terrible HOT 3
- Aggregate digest tool for hourly data
- Replaces email notifications with Rollbar HOT 1
- Sitemap
- Clean up Python cobwebs HOT 1
- Use "net/context" HOT 1
- Rollbar - use "trace" instead of "message" HOT 2
- Tests
- JSON API? HOT 4
- Distinguish between issues and pull requests HOT 3
- Distinguish forks and main repositories
- Link to json format api endpoints from search query results
- Site and API down? HOT 7
- Trying to get in touch regarding a security issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opensourcecontributors.