Permalink
Browse files

Inserting banner into page

  • Loading branch information...
1 parent 767f250 commit 5fdf89f1ddfddac568d5afb051a62fda885239d6 @peat committed Feb 12, 2012
Showing with 14 additions and 0 deletions.
  1. +1 −0 extension/background.html
  2. +6 −0 extension/banner.css
  3. +7 −0 extension/scraper.js
View
1 extension/background.html
@@ -4,6 +4,7 @@
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript( null, {file:"jquery.min.js"});
chrome.tabs.executeScript( null, {file:"scraper.js"});
+ chrome.tabs.insertCSS( null, {file:"banner.css"});
});
</script>
</head>
View
6 extension/banner.css
@@ -0,0 +1,6 @@
+#audibleHarvest {
+ background-color: #FCF7D1;
+ border-bottom: 1px solid #B52C00;
+ box-shadow: 0px 0px 10px #888;
+ text-align:center;
+}
View
7 extension/scraper.js
@@ -52,6 +52,7 @@ AH.init = function() {
if ( scanner ) {
AH.log("Starting " + scanner);
+ AH.notification();
this.scannerInterval = setInterval(scanner, 5000); // 5 seconds
setInterval("AH.processQueue()", 10000);
} else {
@@ -63,6 +64,12 @@ AH.halt = function() {
clearInterval( this.scannerInterval );
}
+AH.notification = function() {
+ // drop a div a the top of the page with a friendly message.
+ jQuery('body').prepend('<div id="audibleHarvest" style="position:absolute; top:0px; z-index:9999; font-size: 10px; padding: 3px;">Audible Harvest is Watching This Page</div>');
+ jQuery('#audibleHarvest').show();
+}
+
AH.twitterStreamScanner = function() {
var set_max = 0; // the maximum timestamp for the current set of activity stream messages
jQuery.each( jQuery('.tweet'), function( idx, ele ) {

0 comments on commit 5fdf89f

Please sign in to comment.