Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: a4f1638643
Fetching contributors…

Cannot retrieve contributors at this time

188 lines (186 sloc) 6.062 kB
<html>
<head>
<title>Blue Bird: Simple Twitter Sentiment Analysis</title>
<script type="text/javascript" src="static/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="static/jquery.qtip-1.0.0-rc3.min.js">
</script>
<style type="text/css">
div.wrapper {
width: 600px;
margin: 10px auto;
}
label { font-weight: bold; }
input[type=input] { width: 480px; }
input[type=submit] { float: right }
textarea {
float: right;
width: 480px;
height: 100px;
}
select {
float: right;
width: 480px;
}
#top {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
background-color: #4099FF;
border-bottom: 5px solid #989898;
}
a { color: white; font-weight: bold }
.advanced {
float: right;
margin: 1px;
}
#options {
margin-top: 10px;
}
.float {
float: left;
width: 600px;
margin-top: 10px;
}
.floatRight { float: right; }
.hidden { display: none; }
img.result {
height: 100%;
display: block;
margin: auto auto;
}
#downloads {
position: fixed;
bottom: 0px;
right: 0px;
background-color: #989898;
padding-left: 10px;
font-weight: bold;
padding: 10px;
text-align: center;
color: white
}
.help {
float: left;
background-color: white;
color: #4099FF;
font-weight: bold;
padding: 0px 6px;
cursor: help;
margin-right: 5px;
margin-left: -20px;
}
</style>
<script type="text/javascript">
function toggleAdvanced() {
$('#options').slideToggle('slow', function() {
$('img.result').css('margin-top', $('#top').height()+'px');
});
}
$(document).ready(function() {
$('#q-help').qtip({
content: 'A comma seperated list of terms to search twitter for and produce a stacked histogram of the simple sentiment score for these searches.',
style: "blue",
show: 'mouseover',
hide: 'mouseout'
});
$('#labels-help').qtip({
content: 'A comma seperated list of labels. The label displays in the graph in place of the search term entered above. They must be in the same order, the first one displays in the graph instead of the first term, the second in place of the second, etc.',
style: "blue",
show: 'mouseover',
hide: 'mouseout'
});
$('#pos_words-help').qtip({
content: 'A comma seperated list of words that indicate positive sentiment. These words are in addition to the existing list.',
style: "blue",
show: 'mouseover',
hide: 'mouseout'
});
$('#neg_words-help').qtip({
content: 'A comma seperated list of words that indicate negative sentiment. These words are in addition to the existing list.',
style: "blue",
show: 'mouseover',
hide: 'mouseout'
});
$('#service-help').qtip({
content: 'The service to gather to data from, by default the tweepy twitter API.',
style: "blue",
show: 'mouseover',
hide: 'mouseout'
});
});
function download(width, height) {
document.sentimentForm.width.value = width;
document.sentimentForm.height.value = height;
document.sentimentForm.action.value = "download";
document.sentimentForm.submit();
}
</script>
</head>
<body>
<div id="top">
<div id="query" class="wrapper">
<form method="get" id="sentimentForm" name="sentimentForm" action=".">
<input type="input" name="q" value="{{ q }}" />
<div class="help" id="q-help">?</div>
<input type="submit" name="analyze" value="Analyze" /><br/>
Use commas to compare multiple searches. (max 8)
<p class="advanced">
<a href="javascript:toggleAdvanced()">
Show additional options.
</a>
</p>
<div id="options" \\
%if not show_advanced:
class="hidden"\\
%end
>
<div class="float">
<label for="labels">Labels:</label>
<div class="help" id="labels-help">?</div>
<input type="input" name="labels" value="{{ labels }}"
class="floatRight"/>
</div>
<div class="float">
<label for="pos.words">Positive words:</label>
<div class="help" id="pos_words-help">?</div>
<textarea name="pos.words">{{ pos_words }}</textarea>
</div>
<div class="float">
<label for="neg.words">Negative words:</label>
<div class="help" id="neg_words-help">?</div>
<textarea name="neg.words">{{ neg_words }}</textarea>
</div>
<div class="float">
<label for="service">Service:</label>
<div class="help" id="service-help">?</div>
<select name="service">
%for service in SERVICES:
<option value="{{ service[0] }}">{{ service[0] }}</option>
%end
</select>
</div>
<input type="hidden" name="width" value="6" />
<input type="hidden" name="height" value="6" />
<input type="hidden" name="action" value="view" />
<center>
<a href="javascript:toggleAdvanced() ">Hide</a>
</center>
</div>
</form>
</div>
</div>
<img src="{{ graph }}" class="result" />
<div id="downloads">
DOWNLOADS
<div>
<!-- <a href="javascript:download(2, 2)">Small</a> | -->
<a href="javascript:download(4, 4)">Medium</a> |
<a href="javascript:download(6, 6)">Large</a>
</div>
</div>
<script type="text/javascript">
$('img.result').css('margin-top', $('#top').height()+'px')
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.