Hackathon-Calendar icon indicating copy to clipboard operation
Hackathon-Calendar copied to clipboard

Create an API for hackathons

Open architv opened this issue 10 years ago • 11 comments

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.

architv avatar Dec 18 '15 09:12 architv

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

maxwofford avatar Dec 18 '15 20:12 maxwofford

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/

maxwofford avatar Dec 19 '15 01:12 maxwofford

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 :)

hydrosquall avatar Dec 19 '15 21:12 hydrosquall

@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,
]

architv avatar Dec 23 '15 09:12 architv

@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.

maxwofford avatar Dec 23 '15 20:12 maxwofford

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"
}

stephnr avatar Dec 25 '15 04:12 stephnr

@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 avatar Dec 26 '15 01:12 maxwofford

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

maxwofford avatar Dec 26 '15 01:12 maxwofford

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

stephnr avatar Dec 26 '15 02:12 stephnr

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!

maxwofford avatar Dec 26 '15 11:12 maxwofford

This works @MaxWofford

Go for it @MaxWofford

But im worried about the location

stephnr avatar Dec 27 '15 08:12 stephnr