Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an API for hackathons #136

Open
architv opened this issue Dec 18, 2015 · 11 comments
Open

Create an API for hackathons #136

architv opened this issue Dec 18, 2015 · 11 comments

Comments

@architv
Copy link

architv commented Dec 18, 2015

Would it be possible to create a hackathons API out of the data? There could be three endpoints

  • /past.json
  • /active.json
  • /upcoming.json

I could help in creating it.

@maxwofford
Copy link

+1. Should it be in this repo though? It might get cluttered if there are so many files.

@maxwofford
Copy link

Just created it in a new repo. If anyone has a reason it should be in this repo, please feel free to post it here.

For the time being it's running at https://floating-lake-5505.herokuapp.com/

@hydrosquall
Copy link
Contributor

This is a great idea!

Perhaps a webhook could be setup from @japacible's side so that a static file gets updated each time this repo is updated, and the API could just serve the static file. Unless the API is accepting parameters (such as results returned by keyword, location, date, etc), this would save you a heroku dyno and get the same effect :)

@architv
Copy link
Author

architv commented Dec 23, 2015

@maxwofford Great work!

Just one thing though, it would be better if the output were more verbose. That is instead of

[  
   "[Smart Money Hackathon](http://www.eventbrite.com/e/smart-money-hackathon-registration-11443791689)",
   "San Francisco, CA",
   "6.6 - 6.8",
   "Date (2014)",
   "Date (2015)"
]

the output could be something like:

[  
   "name": "Smart Money Hackathon"
   "url": "http://www.eventbrite.com/e/smart-money-hackathon-registration-11443791689,
   "location": "San Francisco, CA",
   "startDate": 20140606,
   "endDate": 20140608,
]

@maxwofford
Copy link

@architv I like your format! I've just updated it to output like this:

[{
    "name": "All Star Hacks",
    "url": "http://allstarhacks.tk/",
    "location": "New York City, NY",
    "date": "12.12, 2015"
}, {
    "name": "HackKings",
    "url": "http://hackkings.org/",
    "location": "London, UK",
    "date": "12.12 - 12.13, 2015"
}]

I'll play with the format of the dates next.

@stephnr
Copy link

stephnr commented Dec 25, 2015

Im not too fond with that date format @maxwofford . I would recommend having a start and end date separately so people can use proper date formatting tools. The current format is not compatible.

Here is my suggestion:

( I also suggest using ISO Formatted Date Strings and ISO region codes for full region support

{
    "name": "All Star Hacks",
    "url": "http://allstarhacks.tk/",
    "region": "US",
    "location": "NYC",
    "start-date": "2015-12-12T00:00:00.636Z",
    "end-date": "2015-12-13T00:00:00.636Z"
}

@maxwofford
Copy link

@Stephn-R Got it. Writing the dates to be in that format now.

@japacible I was thinking of the edge-case where a hackathon goes through new years. How will that show up so I can account for it when parsing dates from tables?

@maxwofford
Copy link

Forgot to mention in the last message: I haven't added regions yet, so the dates are wrong.

@stephnr
Copy link

stephnr commented Dec 26, 2015

@maxwofford please do. Without proper region codes, the Date fields wont be properly formatted to support i18n specs

@maxwofford
Copy link

On second though, time is only tracked in days on the table so I'll just track days in the API. Here's a sample:

[{
    "name": "All Star Hacks",
    "url": "http://allstarhacks.tk/",
    "location": "New York City, NY",
    "startDate": "2015-12-12",
    "endDate": "2015-12-12"
}, {
    "name": "HackKings",
    "url": "http://hackkings.org/",
    "location": "London, UK",
    "startDate": "2015-12-12",
    "endDate": "2015-12-13"
}]

If I'm not making sense by doing this, please tell me!

@stephnr
Copy link

stephnr commented Dec 27, 2015

This works @maxwofford

Go for it @maxwofford

But im worried about the location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants