Skip to content
This repository has been archived by the owner on Mar 28, 2021. It is now read-only.

Commit

Permalink
Initalizing...
Browse files Browse the repository at this point in the history
  • Loading branch information
vonbearshark committed Sep 19, 2015
0 parents commit e93b4ef
Show file tree
Hide file tree
Showing 34 changed files with 161 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If you're interested in contributing, just clone it down, branch, make the changes, and submit a PR!
8 changes: 8 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*

----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. Jason Naughton
---------------------------------------------------------------------------- */
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Llamapocalypse First Blood Part II

---

All your headlines are belong to us.

---

Screens:

This is your new existence:

![NYT Screenshot](/llamapocalypsenytscreen.png?raw=true "New York Times")
![LA Times Screenshot](/llamapocalypselatscreen.png?raw=true "LA Times")

---

Download and install [chrome store link]()

---

Based on the Infinite Viral extension: [source](https://github.com/vonbearshark/infinite-viral-extension), [download](https://chrome.google.com/webstore/detail/infinite-viral/gejghfapdoblkdeghocaggoalocccacg)
Binary file added assets/GICoat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ballcap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/bloodCoat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/bloodMouth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/briefcase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/businessCoat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/coatbase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/eyeGlass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/eyePatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/eyepatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fancyCoat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/forkKnife.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/helmet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/jersey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/labcoat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/llamaBase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/llamatemplate.xcf
Binary file not shown.
Binary file added assets/mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/normalCoat1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/normalCoat2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/normalCoat3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pipe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/severedArmPlatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sunglasses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/topHat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions llamapocalypse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* find any news headings and pictures on the page
* load a llama headline and picture
*/

//extends array to include a sample function
Array.prototype.sample = function () {
return this[Math.floor(Math.random() * this.length)]
}

function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}

function getRandomNum() {
return (Math.floor(Math.random() * 15) + 5).toString();
}

function getRandomMost(num) {
num = parseInt(num);
return (Math.floor(Math.random() * num) + 1).toString();
}

function generateHeadline() {
var headlines = ['This is a sample headline'];

decision = viralTemplates.sample();
}
function generatePicture() {

}

//alright, generate the headlines!
//get a headline with: generate();
//find the title on the page
//this is tricky, because their's no standard headlines
//so look through all likely element classes for keywords
//right now it assumes a pretty semantic DOM
(function() {
var headings = Array.prototype.slice.call(document.querySelectorAll('h1, h2, h3, h4, h5, h6, a')).map(
function(heading) {
if(heading.className.toLowerCase().indexOf('story') > -1 ||
heading.className.toLowerCase().indexOf('headline') > -1 ||
heading.className.toLowerCase().indexOf('title') > -1 ||
heading.className.toLowerCase().indexOf('lede') > -1) {

if(heading.tagName === 'A' && /\S/.test(heading.innerText)) {
heading.innerText = generateHeadline();
}
else if (heading.tagName !== 'A'){
//TODO: Assumes first child link is the article heading
var links = Array.prototype.slice.call(heading.querySelectorAll('a'));
if(links.length > 0) {
links[0].innerText = generateHeadline();
}
else {
heading.innerText = generateHeadline();
}
}
}
});
})();

22 changes: 22 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"manifest_version": 2,

"name": "Infinite Viral",
"description": "Viral news all the time.",
"version": "1.1.0",

"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
],
"content_scripts": [
{
"matches": ["*://*/*"],
"js": ["infiniteViral.js"],
"run_at": "document_end"
}
]
}
8 changes: 8 additions & 0 deletions popup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* {

}

body {
background-color: #2196F3;
color: #E3F2FD;
}
10 changes: 10 additions & 0 deletions popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Llamapocalypse</title>
<link rel="stylesheet" type="text/css" href="popup.css">
</head>
<body>
<h1>Llamapocalypse</h1>
</body>
</html>

0 comments on commit e93b4ef

Please sign in to comment.