This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>ProjectName – Code Club</title> | |
<link rel="stylesheet" href="/assets/main-2a7e0e242618c238cd73c2ad7280dec6.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "scratch", | |
"name": "Scratch", | |
"img": "scratch.png", | |
"desc": "Learn how to program your own interactive stories, games and animations.", | |
"long_desc": "Scratch is a graphical programming language, developed by the Lifelong Kindergarten group at the Massachusetts Institute of Technology. Children can drag and combine code blocks to make a range of programs, including animations, stories, musical instruments and games. It’s a bit like the programming equivalent of Lego!" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def event_params | |
event_params = ({:event => { | |
:name => { | |
:html => event.name # this will be a string e.g "Public Event with Damien Hogan" | |
}, | |
:description => { | |
:html => event.description # this will be a string e.g "This event is going to cover the following modules..." | |
}, | |
:organizer_id => ORGANIZER_ID, # ENV variable stored in a Constant. | |
:start => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_event | |
begin | |
response = Http::Exceptions.wrap_and_check do | |
HTTParty.post("https://www.eventbriteapi.com/v3/events/", | |
:body => event_params, | |
:headers => {'Content-Type' => 'application/json', 'Authorization' => AUTH } ) | |
end | |
@returned_event = JSON.parse(response.body) | |
rescue Http::Exceptions::HttpException => e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth = "Bearer OMITTED" | |
response = HTTParty.post("https://www.eventbriteapi.com/v3/events", body: {:event => { | |
:name => { | |
:html => "Event Name" | |
}, | |
:organizer_id => "6272138773", | |
:start => { | |
:timezone => "America/Los_Angeles", | |
:utc => "2015-05-12T02:00:00Z", | |
}, |