Commit d90bffbe authored by militarpancho's avatar militarpancho
Browse files

First changes adapting tourpedia dashboard

parent ef2e8f12
{"timestamp": 1480295055.0, "permalink": "/r/breathinginformation/comments/5f8rcv/cam_sips_an_nfl_logo_thinks_its_a_bit_spicy/?ref=search_posts", "subreddit_id": "t5_2wt24", "archived": true, "author": "joehop", "media": "https://gfycat.com/ShamefulRepentantChipmunk", "search_term": ["NFL"], "id": "5f8rcv", "ups": 12845, "title": "Cam sips an NFL logo, thinks it's a bit spicy", "score": 12845, "downs": 0, "subredditName": "breathinginformation", "num_comments": 60}
{"timestamp": 1498341123.0, "permalink": "/r/nfl/comments/6jarda/ocwhich_teams_have_fewer_fans_than_their_namesake/?ref=search_posts", "subreddit_id": "t5_2qmg3", "archived": false, "author": "TwentyThreeEightyOne", "media": "https://www.reddit.com/r/nfl/comments/6jarda/ocwhich_teams_have_fewer_fans_than_their_namesake/", "search_term": ["NFL"], "id": "6jarda", "ups": 22159, "title": "[OC]Which teams have fewer fans than their namesake? A study", "score": 22159, "downs": 0, "subredditName": "nfl", "num_comments": 1598}
{"timestamp": 1487903411.0, "permalink": "/r/soccer/comments/5vux5s/today_rsoccer_has_surpassed_rnfl_in_subscribers/?ref=search_posts", "subreddit_id": "t5_2qi58", "archived": false, "author": "Avengedx", "media": "https://www.reddit.com/r/soccer/comments/5vux5s/today_rsoccer_has_surpassed_rnfl_in_subscribers/", "search_term": ["NFL"], "id": "5vux5s", "ups": 24810, "title": "Today /r/soccer has surpassed /r/nfl in subscribers, and become the largest sports based sub on Reddit.", "score": 24810, "downs": 0, "subredditName": "soccer", "num_comments": 1661}
{"timestamp": 1485154551.0, "permalink": "/r/todayilearned/comments/5pn0od/til_the_nfl_split_724_billion_in_revenue_with_32/?ref=search_posts", "subreddit_id": "t5_2qqjc", "archived": true, "author": "Agussert", "media": "http://www.sbnation.com/nfl/2015/7/20/9006401/nfl-teams-revenue-tv-deal-7-billion", "search_term": ["NFL"], "id": "5pn0od", "ups": 44876, "title": "TIL The NFL split $7.24 billion in revenue with 32 teams last season, and the one reason we know that is because the Green Bay Packers put out an annual financial report. They are the only non-profit team.", "score": 44876, "downs": 0, "subredditName": "todayilearned", "num_comments": 2350}
{"timestamp": 1481228654.0, "permalink": "/r/hockey/comments/5h9a0x/rnfl_invents_a_new_game/?ref=search_posts", "subreddit_id": "t5_2qiel", "archived": true, "author": "dragonitetrainer", "media": "http://i.imgur.com/KQoeXk7.png", "search_term": ["NFL"], "id": "5h9a0x", "ups": 21880, "title": "/r/NFL invents a new game", "score": 21880, "downs": 0, "subredditName": "hockey", "num_comments": 708}
{"timestamp": 1472588645.0, "permalink": "/r/politics/comments/50d83w/richard_sherman_wants_billionaires_not_taxpayers/?ref=search_posts", "subreddit_id": "t5_2cneq", "archived": true, "author": "rcrevolution13", "media": "http://www.cbssports.com/nfl/news/richard-sherman-wants-billionaires-not-taxpayers-to-pay-for-stadiums/", "search_term": ["NFL"], "id": "50d83w", "ups": 37058, "title": "Richard Sherman wants billionaires, not taxpayers, to pay for stadiums", "score": 37058, "downs": 0, "subredditName": "politics", "num_comments": 2294}
{"timestamp": 1490109089.0, "permalink": "/r/nottheonion/comments/60o4p6/fbi_director_james_comey_admits_under_oath_that/?ref=search_posts", "subreddit_id": "t5_2qnts", "archived": false, "author": "The_Bard", "media": "http://www.foxsports.com/nfl/story/fbi-director-james-comey-admits-under-oath-that-he-hates-the-patriots-032017", "search_term": ["NFL"], "id": "60o4p6", "ups": 46581, "title": "FBI director James Comey admits under oath that he hates the Patriots", "score": 46581, "downs": 0, "subredditName": "nottheonion", "num_comments": 2284}
{"timestamp": 1480732957.0, "permalink": "/r/news/comments/5g7gat/steve_kerr_says_he_used_marijuana_for_back_pain/?ref=search_posts", "subreddit_id": "t5_2qh3l", "archived": true, "author": "redditor01020", "media": "http://www.espn.com/nba/story/_/id/18190785/steve-kerr-says-used-marijuana-back-pain-hopes-leagues-soften-stance", "search_term": ["NFL"], "id": "5g7gat", "ups": 34757, "title": "Steve Kerr says he used marijuana for back pain, hopes leagues soften stance \u2013 \"If you're an NFL player, in particular, and you got lot of pain, I don't think there's any question that pot is better for your body than Vicodin. And yet, athletes everywhere are prescribed Vicodin like it's Vitamin C.\"", "score": 34757, "downs": 0, "subredditName": "news", "num_comments": 1707}
{"timestamp": 1486307090.0, "permalink": "/r/todayilearned/comments/5s7sdh/til_that_in_1972_president_richard_nixon_called/?ref=search_posts", "subreddit_id": "t5_2qqjc", "archived": false, "author": "TheSumOfAllFeels", "media": "http://sports.yahoo.com/news/nfl--president-nixon-tried-to-help-dolphins-win-super-bowl-vi-225925413.html", "search_term": ["NFL"], "id": "5s7sdh", "ups": 40461, "title": "TIL that in 1972, President Richard Nixon called Miami Dolphins head coach Don Shula before the Super Bowl and recommended he run a certain play. The week prior, he reportedly did the same thing with the Washington Redskins. Both teams ran the plays he suggested; both plays failed. Both teams lost.", "score": 40461, "downs": 0, "subredditName": "todayilearned", "num_comments": 1070}
{"timestamp": 1497007426.0, "permalink": "/r/todayilearned/comments/6g7sz7/til_the_nfl_has_no_written_rule_against_female/?ref=search_posts", "subreddit_id": "t5_2qqjc", "archived": false, "author": "Fyre2387", "media": "http://www.espn.com/espn/page2/story?page=easterbrook%2F061114", "search_term": ["NFL"], "id": "6g7sz7", "ups": 39812, "title": "TIL the NFL has no written rule against female players; women would in fact be allowed if they met the league's eligibility requirements.", "score": 39812, "downs": 0, "subredditName": "todayilearned", "num_comments": 6629}
{"score": 1042, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480295752.0, "author": "TheOtherJuggernaut", "likes": null, "parent_id": "t3_5f8rcv", "body": "Title game 10/10", "id": "t1_daico44", "ups": 1042}
{"score": 257, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480300675.0, "author": "DonkeyKongSenior", "likes": null, "parent_id": "t1_daico44", "body": "Nailed it so hard. It's a decent post without the title. It's an A+ post with the title. ", "id": "t1_daig6ue", "ups": 257}
{"score": 86, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480301926.0, "author": "player-piano", "likes": null, "parent_id": "t1_daig6ue", "body": "another thing is that it actually fits the subreddit. this meme is certified dank", "id": "t1_daih3d5", "ups": 86}
{"score": 51, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480315780.0, "author": "Vinylzen", "likes": null, "parent_id": "t1_daih3d5", "body": "I feel like this sub already has to reach so hard for content that when shit like this happens it's so impressive and sick \ud83d\udd25\ud83d\udc4c", "id": "t1_daipqxx", "ups": 51}
{"score": -16, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480330157.0, "author": "[deleted]", "likes": null, "parent_id": "t1_daig6ue", "body": "[deleted]", "id": "t1_daiuo8g", "ups": -16}
{"score": 7, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480340086.0, "author": "mcawkward", "likes": null, "parent_id": "t1_daiuo8g", "body": "With the title its an S", "id": "t1_daiycu6", "ups": 7}
{"score": 21, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480355127.0, "author": "muffley", "likes": null, "parent_id": "t1_daico44", "body": "This is /r/wheredidthesodago level title quality.", "id": "t1_daj8rax", "ups": 21}
{"score": 5, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480358241.0, "author": "boot2skull", "likes": null, "parent_id": "t1_daico44", "body": "7/10 spicy with rice", "id": "t1_dajbdrc", "ups": 5}
{"score": -9, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480330241.0, "author": "[deleted]", "likes": null, "parent_id": "t1_daico44", "body": "[removed]", "id": "t1_daiup68", "ups": -9}
{"score": 233, "downs": 0, "subreddit": "breathinginformation", "subreddit_id": "t5_2wt24", "timestamp": 1480296103.0, "author": "CreamNPeaches", "likes": null, "parent_id": "t3_5f8rcv", "body": "Quality post OP. Better than many I've seen recently.", "id": "t1_daicx85", "ups": 233}
......@@ -23,12 +23,12 @@
url="/endpoint.json"
handle-as="json"
last-response="{{endpoint}}"></iron-ajax>
<template is="dom-repeat" items="{{ids}}" as="id">
<!-- <template is="dom-repeat" items="{{ids}}" as="id">
<iron-ajax auto
url="{{getName(id)}}"
handle-as="json"
on-response="addPlace"></iron-ajax>
</template>
</template> -->
<paper-tabs selected="{{selected}}">
<paper-tab>Dashboard</paper-tab>
......@@ -50,30 +50,13 @@
<div style="width: 23%; margin-right: 2.6%; float: left">
<number-chart
data="{{data}}"
object="restaurant"
object="todayilearned"
aggKey="subredditName"
title="Restaurants"
icon="maps:local-dining"
stylebg="bg-yellow">
</number-chart>
</div>
<div style="width: 23%; margin-right: 2.6%; float: left">
<number-chart
data="{{data}}"
object="poi"
title="POIs"
icon="social:whatshot"
stylebg="bg-green">
</number-chart>
</div>
<div style="width: 23%; float: left">
<number-chart
icon="maps:hotel"
data="{{data}}"
title="Accommodations"
object="accommodation"
stylebg="bg-aqua">
</number-chart>
</div>
</div>
<!-- <div style="width: 100%; display: inline-block"> -->
<!-- <div style="width: 23%; margin-right: 2.6%; float: left"> -->
......@@ -109,9 +92,11 @@
<!-- </div> -->
<div style="width: 100%; display: inline-block">
<div class="chart_container" style="right: 0; float: right">
<!--
<google-chart
data="{{data}}"
field="location"
field="subredditName"
id='pie-chart4'
extra-id='pie-chart4'
type='pie'
......@@ -119,19 +104,19 @@
icon='maps:my-location'
param='{{param}}'
options='{"title": "Places at different cities"}'
cols='[{"label": "Place", "type": "string"},{"label": "Count", "type": "number"}]'
cols='[{"label": "subredditName", "type": "string"},{"label": "Count", "type": "number"}]'
</google-chart>
</div>
-->
<div class="chart_container" style="left: 0; float: left">
<google-chart
field="category"
field="subredditName"
data="{{data}}"
id='pie-chart3'
extra-id='pie-chart3'
type='pie'
filters="{{filters}}"
icon='room'
param="{{param}}"
options='{"title": "Different types of places"}'
cols='[{"label": "Sentiment", "type": "string"},{"label": "Count", "type": "number"}]'
</google-chart>
......@@ -218,8 +203,8 @@
if(ready){
this.client.search({
// undocumented params are appended to the query string
index: "tourpedia",
type: "places",
index: "reddit",
type: "article",
body: {
size: 10,
query: {
......@@ -228,33 +213,9 @@
}
},
aggs: {
category: {
terms: {
field: "category",
order: {
_count: "desc"
}
}
},
location: {
terms: {
field: "location",
order: {
_count: "desc"
}
}
},
numReviews: {
terms: {
field: "numReviews",
order: {
_count: "desc"
}
}
},
polarity: {
subredditName: {
terms: {
field: "polarity",
field: "subredditName",
order: {
_count: "desc"
}
......@@ -268,7 +229,8 @@
that.ids = myids;
//console.log(that.ids)
that.data = resp;
//console.log(that.data)
console.log("DATA");
console.log(that.data);
});
}
......
#!/bin/sh
curl -XPUT http://localhost:9200/tourpedia/_mapping/places -d '
curl -XPUT http://localhost:9200/reddit/_mapping/article -d '
{
"properties": {
"location": {
"type": "text",
"fielddata": true
},
"category": {
"subredditName": {
"type": "text",
"fielddata": true
}
}
}'
\ No newline at end of file
}'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment