This file contains 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
streamingClient.search({ | |
index: 'checkin', | |
type: 'city', | |
body: { | |
query : { | |
match_all : {} | |
}, | |
filter : { | |
geo_distance : { | |
distance : "12km", |
This file contains 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
var myApp = angular.module('myApp', ['elasticsearch','ngMap']); | |
myApp.service('client', function (esFactory) { | |
return esFactory({ | |
host: 'https://Uxa3m5nPP:ae4d2bf0-7669-4ba7-8849-3475576501c3@scalr.api.appbase.io', | |
}); | |
}); | |
This file contains 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
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
This file contains 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
package main | |
import ( | |
"fmt" | |
"strconv" | |
"time" | |
"github.com/fsouza/go-dockerclient" | |
"github.com/samuel/go-zookeeper/zk" | |
) |
This file contains 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
data-controller.js | |
Creates a prototype which is responsible for four different queries. This file contains four functions which help to stream the data from appbase. | |
1.getSuggestions() | |
This function matches the input strings with the stored data and provides the suggestions related to specific queries. | |
2.getSearchCheckin() | |
Provides existing checkins according to the searched city. | |
3.getliveData() | |
Streams the live checkins. Which renders on a map with the blue marker. | |
4.getDragData() | |
This function streams the old data around the radius of 2000km from the center of map |
This file contains 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
A Check in JSON data looks like this: | |
{ | |
"shout": "Columbus Realtors Directors Meeting", | |
"city": "columbus", | |
"category": "Office", | |
"latitude": 39.996149824327, | |
"longitude": -82.93393505324137, | |
"venue": "Columbus REALTORS®", | |
"city_suggest": "Columbus", | |
"url": "swarmapp.com/c/96gB6gzzl34", |
This file contains 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
if err != nil { | |
pc, fn, line, _ := runtime.Caller(1) | |
message := fmt.Sprintf("[error] %s[%s:%d] %s", runtime.FuncForPC(pc).Name(), fn, line, err.Error()) | |
log.Println(message) | |
} |
This file contains 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
this.getSuggestions = function(text) { | |
return appbaseRef.search({ | |
index: 'checkin', | |
body: { | |
suggest: { | |
mysuggester: { | |
text: text, | |
completion: { | |
field: 'city_suggest' | |
} |
This file contains 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 data-ng-app="myApp"> | |
<head> | |
<title>Now : A RealTime Application</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<!-- Css START --> | |
<link rel="stylesheet" href="src/bower_components/bootstrap/dist/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="src/bower_components/font-awesome/css/font-awesome.min.css" /> | |
<link href="https://fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,700,700italic,900,900italic%7cOpen+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic" rel=stylesheet type=text/css /> |
This file contains 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
function dragProcess(response) { | |
if (response.hits) { | |
for (var i = 0; i < response.hits.hits.length; i++) { | |
if (response.hits.hits[i]._source) { | |
if (response.hits.hits[i]._source.latitude && response.hits.hits[i]._source.longitude) { | |
if (citysearched == response.hits.hits[i]._source.city) | |
continue; | |
var default_arr = helper.getMapArray(response.hits.hits[i]._source); | |
var specific_arr = [ | |
'src/assets/img/yellow_marker.png' |
OlderNewer