Skip to content
This repository has been archived by the owner on Feb 17, 2018. It is now read-only.

Commit

Permalink
now should also work w/settings
Browse files Browse the repository at this point in the history
  • Loading branch information
riedel committed Dec 30, 2011
1 parent bc648dc commit c0af1d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 99 deletions.
99 changes: 2 additions & 97 deletions lib/cfg.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,108 +30,13 @@ var fs = require('fs'),
// external libraries
var func = require('./func.js');
var log=null;
var settings = {
"proxy":
{
"bind": "127.0.0.1",
"port": 13232,
"banner": "Feedability/0.0",
"preserve_order": true,
"use_auth": false,
"auth": "user:pass"
},

"urlopen":
{
"cache": true,
"headers":
{
"User-Agent": "Mozilla/5.0 (compatible; Feedability/0.0; +https://github.com/4poc/feedability)",
"Accept": "*/*"
},
"ignore_http_charset": true,
"convert_charset": true
},

"cookies":
{
"activate": false,
"whitelist": [],
"type": "firefox_sqlite",
"cookie_jar": "/home/user/.mozilla/firefox/abcdefgh.default/cookies.sqlite"
},

"ce":
{
"cache": true
},

"ce_single":
{
"cache": false
},

"filter":
{
"activate": true,
"jquery_url": "http://code.jquery.com/jquery-1.4.2.min.js",
"rules":
{
".*":
{
"post":
{
"replace":
{
"(src|href)=('|\")?(\/)": "$1=$2%{URL_BASE}",
"<script[^>]*>([\\s\\S]*?)</script>": " ",
"onclick=\"[^\"]+\"": ""
},
"remove": ["object"]
}
},
"heise.de":
{
"pre":
{
"remove": ["#mitte_rechts"]
}
},
"carta.info":
{
"pre":
{
"remove": ["#commentblock"]
}
},
"giessener-allgemeine.de":
{
"prepend": [".fettvorspann"]
}
}
},

"cache":
{
"path": "./cache"
},

"log":
{
"console": true,
"stderr": false,
"file": false,
"console_level": 3,
"file_level": 4
}

};
var settings=null;

// load the configuration settings
function load() {
if(settings == null) {
console.log('[load settings.json file]');
settings = JSON.parse(fs.readFileSync('settings.json', 'utf8'));
settings = JSON.parse(fs.readFileSync(__dirname+'/../settings.json', 'utf8'));
if(func.file_exists('user_settings.json')) {
console.log('[found and load the user_settings.json file]');
var user_settings = JSON.parse(
Expand Down
4 changes: 2 additions & 2 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

"urlopen":
{
"cache": true,
"cache": false,
"headers":
{
"User-Agent": "Mozilla/5.0 (compatible; Feedability/0.0; +https://github.com/4poc/feedability)",
Expand All @@ -31,7 +31,7 @@

"ce":
{
"cache": true
"cache": false
},

"ce_single":
Expand Down

0 comments on commit c0af1d5

Please sign in to comment.