From ccea5734bddce248b63c993584b35e407f32993a Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 29 Oct 2016 11:25:24 -0400 Subject: [PATCH 1/2] adding meetup api to homepage. TESTING. --- css/style.css | 13 +++++++++++++ index.html | 8 ++++++-- js/meetup/meetup.js | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 js/meetup/meetup.js diff --git a/css/style.css b/css/style.css index 119edd0..79ba296 100644 --- a/css/style.css +++ b/css/style.css @@ -197,6 +197,19 @@ text-align: center; } + + /* Meetup + -------------------------------------------------- */ + + .meetup{width:60%; position:relative; margin:auto; clear:both} +.meetup h3{float:left; width:100%; text-align:center; margin:4% 0px} +.meetup span { margin-left:1%; border: 2px solid; + border-radius:100px; font-size:18px; padding:0px 2%;} +.meetup #description {float:left;} +.meetup #status{width:100%; float:left; text-align:center; margin-bottom:2%} + + + /* RESPONSIVE CSS -------------------------------------------------- */ diff --git a/index.html b/index.html index 7ecb64c..ef4cc32 100644 --- a/index.html +++ b/index.html @@ -256,10 +256,12 @@

We Meet Often. Come Join Us.< href="https://www.facebook.com/CodeForFTL"> Facebook to learn more about events and projects.

-
+ +
+

@@ -344,6 +346,8 @@

Ryan Gates

fjs.parentNode.insertBefore(js, fjs); return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } }); }(document, "script", "twitter-wjs")); + + diff --git a/js/meetup/meetup.js b/js/meetup/meetup.js new file mode 100644 index 0000000..8934d6a --- /dev/null +++ b/js/meetup/meetup.js @@ -0,0 +1,40 @@ +$(document).ready(function(){ + $title = $('#title'); + $meetup = $('.meetup'); + + + $.ajax({ + type:"GET", // GET = requesting data + url:"https://api.meetup.com/code-for-FTL/events?&sign=true&photo-host=public&page=20", + success: function(response) { + + $(response.data).each(function(index, value){ + var getdate = new Date(value.time).toString().substring(0,16); + var gettime = new Date(value.time).toLocaleTimeString(); + $meetup.append( + + "

"+ value.name +"

\ +
"+"rsvp:"+value.yes_rsvp_count+ " " + getdate +" "+gettime+"
\ +

"+value.description + "

" + + + ); + + console.log(value['description']); + + }); + + + + + + // $users.append().text(JSON.stringify(data['data'][1])); + + // $users.append().text(JSON.stringify(response)); + // $('.text').text(JSON.stringify(data)); // Set data that comes back from the server to 'text' + }, + // error: function() + dataType: 'jsonp', + }); + +}); \ No newline at end of file From 43aad9c886ab181e3571eae93748c13b6c16e326 Mon Sep 17 00:00:00 2001 From: Michael A Date: Sat, 29 Oct 2016 11:43:07 -0400 Subject: [PATCH 2/2] Removed uncommented code. --- js/meetup/meetup.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/js/meetup/meetup.js b/js/meetup/meetup.js index 8934d6a..4d33c3d 100644 --- a/js/meetup/meetup.js +++ b/js/meetup/meetup.js @@ -4,7 +4,7 @@ $(document).ready(function(){ $.ajax({ - type:"GET", // GET = requesting data + type:"GET", url:"https://api.meetup.com/code-for-FTL/events?&sign=true&photo-host=public&page=20", success: function(response) { @@ -20,21 +20,16 @@ $(document).ready(function(){ ); - console.log(value['description']); }); - - // $users.append().text(JSON.stringify(data['data'][1])); - - // $users.append().text(JSON.stringify(response)); - // $('.text').text(JSON.stringify(data)); // Set data that comes back from the server to 'text' + }, - // error: function() + dataType: 'jsonp', }); -}); \ No newline at end of file +});