Commit 2d6e26aa authored by militarpancho's avatar militarpancho
Browse files

A lot of changes

parent d90bffbe
from node:7.10.0
ENV NODE_PATH=/tmp/node_modules APP_NAME=dashboard-tourpedia
ENV NODE_PATH=/tmp/node_modules APP_NAME=dashboard-reddit
# Install dependencies first to use cache
RUN npm install -g http-server bower
......
{"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}
{
"name": "dashboard-tourpedia",
"name": "dashboard-reddit",
"authors": [
"gsi-upm"
],
"description": "Dashboard to visualize data from TourPedia API",
"main": "dashboard-tourpedia.html",
"description": "Dashboard to visualize data from reddit API",
"main": "dashboard-reddit.html",
"keywords": [
"dashboard",
"web-component",
......@@ -33,5 +33,5 @@
"elastic.js": "^1.2.0"
},
"license": "Apache-2.0",
"homepage": "https://lab.cluster.gsi.dit.upm.es/sefarad/dashboard-tourpedia"
"homepage": "https://lab.cluster.gsi.dit.upm.es/sefarad/dashboard-reddit"
}
......@@ -7,7 +7,7 @@
<link rel="import" href="../number-chart/number-chart.html">
<dom-module id="dashboard-tourpedia">
<dom-module id="dashboard-reddit">
<style is="custom-style">
@import url("../../styles/app-theme.html");
......@@ -40,74 +40,51 @@
<material-search search-value="{{query}}"></material-search>
<br>
<div style="width: 100%; display: inline-block">
<div style="width: 23%; margin-right: 2.6%; float: left">
<div style="width: 23%; margin-right: 2%; float: left">
<number-chart
icon="info"
stylebg="bg-red"
data="{{data}}">
</number-chart>
</div>
<div style="width: 23%; margin-right: 2.6%; float: left">
<div style="width: 23%; margin-right: 2%; float: left">
<number-chart
data="{{data}}"
object="todayilearned"
aggKey="subredditName"
title="Restaurants"
icon="maps:local-dining"
object="article"
aggKey="type"
title="Articles"
icon="icons:receipt"
stylebg="bg-yellow">
</number-chart>
</div>
</div>
<!-- <div style="width: 100%; display: inline-block"> -->
<!-- <div style="width: 23%; margin-right: 2.6%; float: left"> -->
<!-- <number-chart -->
<!-- data="{{data}}" -->
<!-- object="londres" -->
<!-- title="Londres" -->
<!-- icon="maps:local-dining" -->
<!-- aggkey="location" -->
<!-- stylebg="bg-yellow"> -->
<!-- </number-chart> -->
<!-- </div> -->
<!-- <div style="width: 23%; margin-right: 2.6%; float: left"> -->
<!-- <number-chart -->
<!-- data="{{data}}" -->
<!-- object="madrid" -->
<!-- aggkey="location" -->
<!-- title="Madrid" -->
<!-- icon="social:whatshot" -->
<!-- stylebg="bg-green"> -->
<!-- </number-chart> -->
<!-- </div> -->
<!-- <div style="width: 23%; float: left"> -->
<!-- <number-chart -->
<!-- icon="maps:hotel" -->
<!-- data="{{data}}" -->
<!-- title="Paris" -->
<!-- object="paris" -->
<!-- aggkey="location" -->
<!-- stylebg="bg-aqua"> -->
<!-- </number-chart> -->
<!-- </div> -->
<!-- </div> -->
<div style="width: 23%; margin-right: 2%; float: left">
<number-chart
data="{{data}}"
object="comment"
aggKey="type"
title="Comments"
icon="maps:rate-review"
aggkey="location"
stylebg="bg-green">
</number-chart>
</div>
</div>
<div style="width: 100%; display: inline-block">
<div class="chart_container" style="right: 0; float: right">
<!--
<google-chart
data="{{data}}"
field="subredditName"
field="subreddit"
id='pie-chart4'
extra-id='pie-chart4'
type='pie'
filters="{{filters}}"
icon='maps:my-location'
param='{{param}}'
options='{"title": "Places at different cities"}'
options='{"title": "Comments Subreddits"}'
cols='[{"label": "subredditName", "type": "string"},{"label": "Count", "type": "number"}]'
</google-chart>
</div>
-->
</div>
<div class="chart_container" style="left: 0; float: left">
<google-chart
field="subredditName"
......@@ -117,11 +94,56 @@
type='pie'
filters="{{filters}}"
icon='room'
options='{"title": "Different types of places"}'
options='{"title": "Articles Subreddits"}'
cols='[{"label": "Sentiment", "type": "string"},{"label": "Count", "type": "number"}]'
</google-chart>
</div>
</div>
<div style="width: 100%">
<div class="chart_container" style="left: 0; float: left">
<google-chart
id='column-chart1'
extra-id='column-chart1'
type='column'
filters="{{filters}}"
icon='maps:rate-review'
data = {{data}}
field = num_comments
param='{{param}}'
optionsbi='{"legend": "none"}'
options='{"title": "Count of number of comments"}'
cols='[{"label": "Reviews", "type": "number"},{"label": "Count", "type": "number"}]'
rows='[ [0, 31],[1, 28],[2, 31],[3, 30],[4, 30],[5, 31],[6, 30] ]'>
</google-chart>
</div>
<div class="chart_container" style="right: 0; float: right">
<!--<google-chart
data = {{data}}
field = "sentiment"
id='bar-chart3'
extra-id='bar-chart3'
type='bar'
filters="{{filters}}"
icon='maps:local-play'
optionsbi='{"legend": "none"}'
options='{"title": "Count of different polarities"}'
cols='[{"label": "Polarity", "type": "number"},{"label": "Count", "type": "number"}]'
rows='[ ["Jan", 31],["Feb", 28],["Mar", 31],["Apr", 30],["May", 31],["Jun", 30] ]'>
</google-chart>
</div>-->
<div style="clear: both"></div>
</div>
<div style="width: 100%">
<div class="chart_container" style="left: 0; float: left">
<reviews-table
data = "{{data}}"
field = "title"
filters="{{filters}}"
fields='["category", "location"]'
icon='social:people'>
</reviews-table>
</div>
</div>
</div>
</iron-pages>
</template>
......@@ -129,7 +151,7 @@
<script>
var ready = false;
Polymer({
is: 'dashboard-tourpedia',
is: 'dashboard-reddit',
properties: {
selected: {
type: Number,
......@@ -204,7 +226,7 @@
this.client.search({
// undocumented params are appended to the query string
index: "reddit",
type: "article",
type: ["article","comment"],
body: {
size: 10,
query: {
......@@ -220,7 +242,23 @@
_count: "desc"
}
}
}
},
type: {
terms: {
field: "_type",
order: {
_count: "desc"
}
}
},
subreddit: {
terms: {
field: "subreddit",
order: {
_count: "desc"
}
}
}
}
}
}).then(function (resp) {
......@@ -229,8 +267,7 @@
that.ids = myids;
//console.log(that.ids)
that.data = resp;
console.log("DATA");
console.log(that.data);
//console.log(that.data);
});
}
......
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/elastic-client/elastic-client.html">
<link rel="import" href="../bower_components/dashboard-tourpedia/dashboard-tourpedia.html">
<link rel="import" href="../bower_components/dashboard-reddit/dashboard-reddit.html">
......@@ -19,8 +19,8 @@
cluster-status="{{myStatus}}">
</elastic-client>
<dashboard-tourpedia
client="{{client}}"></dashboard-tourpedia>
<dashboard-reddit
client="{{client}}"></dashboard-reddit>
<!-- <button id="databutton" onclick="changedata()">Click to change data</button> -->
<script>
var datas =[
......
......@@ -7,4 +7,13 @@ curl -XPUT http://localhost:9200/reddit/_mapping/article -d '
"fielddata": true
}
}
}'
curl -XPUT http://localhost:9200/reddit/_mapping/comment -d '
{
"properties": {
"subreddit": {
"type": "text",
"fielddata": true
}
}
}'
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