<?php include "head.php"; require "fllat.php"; $components = new Fllat("components", "../atomic-db"); $categories = new Fllat("categories", "../atomic-db"); $settings = new Fllat("settings", "../atomic-db"); $compSelect = $components->select(array()); $categories = $categories->select(array()); $settings = $settings->select(array()); ?> <body id="atomsWrap" class="atoms" xmlns="http://www.w3.org/1999/html"> <div class="grid-row atoms-container"> <div class="atoms-side_show-small "> <span class="toggle-line"></span> <span class="toggle-line"></span> <span class="toggle-line"></span> </div> <div class="atoms-side_show "> <span class="js-showSide fa fa-arrow-right"></span> </div> <aside class="atoms-side"> <div class="atoms-overflow"> <form class="atomic-search" method="GET"> <input class="searchInput" type="text" placeholder="Search components" name="search"/> </form> <div class="atoms-side_hide"> <span class="js-hideSide navIcon navIcon-left fa fa-arrow-left"></span> <span class="navIcon js_searchTrigger fa fa-search "></span>
/** * Merges two databases and gets rid of duplicates * * @param array $cols the columns to merge * @param Fllat $second the second database to merge * * @return array the merged array */ function union($cols, $second) { return array_map("unserialize", array_unique(array_map("serialize", array_merge($this->select($cols), $second->select($cols))))); }
//-- Hashtag to search $search = "#hackference"; //-- Out main details $main = array(); //-- Get Tweets $url = 'https://api.twitter.com/1.1/search/tweets.json'; $getfield = '?q=' . $search; $requestMethod = 'GET'; $twitter = new TwitterAPIExchange($settings); $response = $twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest(); //-- Pusher time $pusher = new Pusher($pushers['app_key'], $pushers['app_secret'], $pushers['app_id']); $data = json_decode($response, true); //-- Work out tweets $tweets = array(); foreach ($pie->select(array("id")) as $n => $id) { $ids[] = $id['id']; } foreach ($data['statuses'] as $n => $tweet) { if (!isset($tweet['retweeted_status'])) { //-- Check for duplicate if (!in_array($tweet['id'], $ids, true) || isset($_GET['first'])) { $output = array(); $output['text'] = $tweet['text']; $output['user'] = $tweet['user']['screen_name']; $output['avatar'] = $tweet['user']['profile_image_url']; $output['date'] = strtotime($tweet['created_at']); $tweets[] = $output; //-- Store ID, so we don't double show $datas = array("id" => $tweet['id']); $pie->add($datas);