<?php

include dirname(__FILE__) . '/cache/top-cache.php';
include dirname(__FILE__) . "/meetupAPI.php";
include dirname(__FILE__) . "/apiKeys.php";
$cities = array('MTL', 'TO', 'KW', 'VAN', 'SF', 'BOS', 'PAR', 'AMS', 'LAX', 'NYC', 'LDN', 'BCN', 'LIMA', 'DC', 'OSLO', 'MUC', 'SR');
$totalMembers = 0;
$totalEvents = 0;
$meetup = new Meetup(array('key' => $meetup_key));
$members_and_events_array = array('meetupMembersCount' => array(), 'meetupEventsCount' => array());
foreach ($cities as $city) {
    $membersResponse = $meetup->getGroup(array('urlname' => "NeuroTech{$city}"));
    $eventsResponse = $meetup->getEvents(array('group_urlname' => "NeuroTech{$city}", 'status' => "upcoming,past"));
    // Assign the members count of a city's meetup group to a separate variable.
    // For example, the member count of Montreal's meetup group will be $MTL_members_count
    $members_and_events_array['meetupMembersCount'][$city] = $membersResponse->members;
    $members_and_events_array['meetupEventsCount'][$city] = count($eventsResponse);
    $totalMembers += $membersResponse->members;
    $totalEvents += count($eventsResponse);
}
// Get members count for the Paris-CogLab-Meetup-Cognitive-Science-Open-Lab group
$ParisCogLab = "Paris-CogLab-Meetup-Cognitive-Science-Open-Lab";
$membersResponse = $meetup->getGroup(array('urlname' => $ParisCogLab));
$eventsResponse = $meetup->getEvents(array('group_urlname' => $ParisCogLab, 'status' => "upcoming,past"));
$members_and_events_array['meetupMembersCount']['ParisCogLab'] = $membersResponse->members;
$members_and_events_array['meetupEventsCount']['ParisCogLab'] = count($eventsResponse);
$totalMembers += $membersResponse->members;
$totalEvents += count($eventsResponse);
$members_and_events_array['meetupMembersCount']['total'] = $totalMembers;
$members_and_events_array['meetupEventsCount']['total'] = $totalEvents;
echo json_encode($members_and_events_array);
Esempio n. 2
0
 * Kristen Curtze - Chapter Leader @ GDI Rochester
 */
require '../config.php';
require '../meetup.php';
if (!empty($_POST['chapter_url'])) {
    $eventList = null;
    $error = false;
    //get URL from form
    $gdiChapter = $_POST['chapter_url'];
    //explode full URL to just ending
    $gdiChapter = explode("meetup.com/", $gdiChapter);
    //clean extra slashes
    $gdiChapter = str_replace("/", "", $gdiChapter[1]);
    try {
        $meetup = new Meetup(array('key' => $MEETUP_KEY));
        $results = $meetup->getEvents(array('group_urlname' => $gdiChapter, 'status' => 'past', 'desc' => 'true'));
        foreach ($results->results as $meet) {
            $eventList .= "<strong>What:</strong> " . $meet->name . "<br/>";
            $eventList .= "<strong>When:</strong> " . date('m/d/Y g:i a', $meet->time / 1000) . "<br/>";
            $eventList .= "<strong>Where:</strong> " . $meet->venue->name . "<br/>";
            $eventList .= $meet->venue->address_1 . " / ";
            if (!empty($meet->venue->address_2)) {
                $eventList .= $meet->venue->address_2 . " / ";
            }
            $eventList .= $meet->venue->city . ", " . $meet->venue->state . " " . $meet->venue->zip;
            $eventList .= "<br/><br/>";
        }
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
}
Esempio n. 3
0
    }
    //See if there is more data ("next" is set) -- loop through again if so...
    if (strlen($results->meta->next) > 0) {
        $nextSet = $meetup->getNext($results);
        loopThroughNext($meetup, $nextSet, $progressArray);
    }
}
if (!empty($_POST['meetup_ids'])) {
    $groupID = null;
    $error = false;
    $gdiChapter = $_POST['meetup_ids'];
    $timeFrame = $_POST['meetup_range'];
    $finalArray = array();
    try {
        $meetup = new Meetup(array('key' => $MEETUP_KEY));
        $results = $meetup->getEvents(array('group_id' => $gdiChapter, 'page' => '200', 'status' => 'upcoming,past', 'time' => $timeFrame));
        //Meetup has a limit so we need to loop through it to get all chapter info
        loopThroughNext($meetup, $results, $finalArray);
        //Pass back results to be parsed by jquery
        echo json_encode($finalArray);
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
} else {
    ?>
<!DOCTYPE html>
<html lang="en">
<head>

  <!-- Basic Page Needs
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
Esempio n. 4
0
    // 				</p>
    // 				" . $footnote . "
    // 			</div>
    // 		</div>" . $linkEnd;
    // }
} else {
    $events = array();
    $pastNewsLimit = 60 * 60 * 24 * 30 * 3;
    // three months
    $contributors = array();
    $contributorsMin = array();
    $stars = 0;
    try {
        $meetup = new Meetup(array('key' => '{{site.meetup_key}}'));
        try {
            $response = $meetup->getEvents(array('group_urlname' => 'Tachyon', 'status' => 'upcoming,past', 'only' => 'name,time,event_url,description'));
        } catch (Exception $e) {
            echo $e->getMessage();
        }
        $res = $response->results;
        foreach ($res as $event) {
            if ($event->time / 1000 > microtime(true) - $pastNewsLimit) {
                if (strlen($event->name) > 45) {
                    $event->name = substr($event->name, 0, 45) . "...";
                }
                array_push($events, array("title" => $event->name, "date" => $event->time, "desc" => substr(strip_tags(html_entity_decode($event->description)), 0, 120), "link" => $event->event_url, "type" => "meetup"));
            }
        }
    } catch (Exception $e) {
        //echo $e->getMessage();
    }