diff options
Diffstat (limited to 'inc/3rdparty')
-rw-r--r-- | inc/3rdparty/FlattrItem.class.php | 49 | ||||
m--------- | inc/3rdparty/site_config | 0 | ||||
-rw-r--r-- | inc/3rdparty/site_config/README.txt | 6 | ||||
-rw-r--r-- | inc/3rdparty/site_config/custom/bfmtv.com.txt | 6 | ||||
-rw-r--r-- | inc/3rdparty/site_config/custom/inthepoche.com.txt | 7 | ||||
-rw-r--r-- | inc/3rdparty/site_config/custom/tldp.org.txt | 6 | ||||
-rw-r--r-- | inc/3rdparty/site_config/index.php | 3 | ||||
-rw-r--r-- | inc/3rdparty/site_config/standard/.wikipedia.org.txt | 19 | ||||
-rw-r--r-- | inc/3rdparty/site_config/standard/index.php | 3 | ||||
-rw-r--r-- | inc/3rdparty/site_config/standard/version.php | 2 |
10 files changed, 49 insertions, 52 deletions
diff --git a/inc/3rdparty/FlattrItem.class.php b/inc/3rdparty/FlattrItem.class.php new file mode 100644 index 00000000..c940fcd6 --- /dev/null +++ b/inc/3rdparty/FlattrItem.class.php | |||
@@ -0,0 +1,49 @@ | |||
1 | <?php | ||
2 | /* | ||
3 | * Class for Flattr querying | ||
4 | */ | ||
5 | class FlattrItem { | ||
6 | |||
7 | public $status; | ||
8 | public $urltoflattr; | ||
9 | public $flattrItemURL; | ||
10 | public $numflattrs; | ||
11 | |||
12 | public function checkItem($urltoflattr) { | ||
13 | $this->cacheflattrfile($urltoflattr); | ||
14 | $flattrResponse = file_get_contents(CACHE . "/flattr/".base64_encode($urltoflattr).".cache"); | ||
15 | if($flattrResponse != FALSE) { | ||
16 | $result = json_decode($flattrResponse); | ||
17 | if (isset($result->message)){ | ||
18 | if ($result->message == "flattrable") { | ||
19 | $this->status = FLATTRABLE; | ||
20 | } | ||
21 | } | ||
22 | elseif ($result->link) { | ||
23 | $this->status = FLATTRED; | ||
24 | $this->flattrItemURL = $result->link; | ||
25 | $this->numflattrs = $result->flattrs; | ||
26 | } | ||
27 | else { | ||
28 | $this->status = NOT_FLATTRABLE; | ||
29 | } | ||
30 | } | ||
31 | else { | ||
32 | $this->status = "FLATTR_ERR_CONNECTION"; | ||
33 | } | ||
34 | } | ||
35 | |||
36 | private function cacheflattrfile($urltoflattr) { | ||
37 | if (!is_dir(CACHE . '/flattr')) { | ||
38 | mkdir(CACHE . '/flattr', 0777); | ||
39 | } | ||
40 | |||
41 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache | ||
42 | if ((!file_exists(CACHE . "/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime(CACHE . "/flattr/".base64_encode($urltoflattr).".cache") > 86400)) { | ||
43 | $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr); | ||
44 | $flattrCacheFile = fopen(CACHE . "/flattr/".base64_encode($urltoflattr).".cache", 'w+'); | ||
45 | fwrite($flattrCacheFile, $askForFlattr); | ||
46 | fclose($flattrCacheFile); | ||
47 | } | ||
48 | } | ||
49 | } \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config b/inc/3rdparty/site_config new file mode 160000 | |||
Subproject fe9f0d3f60d44a8701f3ecab0c4077a4ed39bfe | |||
diff --git a/inc/3rdparty/site_config/README.txt b/inc/3rdparty/site_config/README.txt deleted file mode 100644 index 0aff456b..00000000 --- a/inc/3rdparty/site_config/README.txt +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | Full-Text RSS Site Patterns | ||
2 | --------------------------- | ||
3 | |||
4 | Site patterns allow you to specify what should be extracted from specific sites. | ||
5 | |||
6 | Please see http://help.fivefilters.org/customer/portal/articles/223153-site-patterns for more information. \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/custom/bfmtv.com.txt b/inc/3rdparty/site_config/custom/bfmtv.com.txt deleted file mode 100644 index 0ff28d56..00000000 --- a/inc/3rdparty/site_config/custom/bfmtv.com.txt +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | title: //title | ||
2 | body: //h2 | //span[@class='masque'] | //article[@class='corps_article_right'] | ||
3 | prune: no | ||
4 | tidy: no | ||
5 | |||
6 | test_url: http://www.bfmtv.com/societe/cigarette-electronique-dangers-588622.html \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/custom/inthepoche.com.txt b/inc/3rdparty/site_config/custom/inthepoche.com.txt deleted file mode 100644 index ede74b97..00000000 --- a/inc/3rdparty/site_config/custom/inthepoche.com.txt +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | title: //title | ||
2 | body: //div[@class='post-content'] | ||
3 | |||
4 | prune: no | ||
5 | tidy: no | ||
6 | |||
7 | test_url: http://www.inthepoche.com/?post/poche-hosting \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/custom/tldp.org.txt b/inc/3rdparty/site_config/custom/tldp.org.txt deleted file mode 100644 index 7dd5cdb5..00000000 --- a/inc/3rdparty/site_config/custom/tldp.org.txt +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | title: //title | ||
2 | body: //h2 | //p | //ul | ||
3 | prune: no | ||
4 | tidy: no | ||
5 | |||
6 | test_url: http://www.tldp.org/HOWTO/Plug-and-Play-HOWTO-7.html \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/index.php b/inc/3rdparty/site_config/index.php deleted file mode 100644 index a3d5f739..00000000 --- a/inc/3rdparty/site_config/index.php +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | <?php | ||
2 | // this is here to prevent directory listing over the web | ||
3 | ?> \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/standard/.wikipedia.org.txt b/inc/3rdparty/site_config/standard/.wikipedia.org.txt deleted file mode 100644 index 8b98ae4b..00000000 --- a/inc/3rdparty/site_config/standard/.wikipedia.org.txt +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | title: //h1[@id='firstHeading'] | ||
2 | body: //div[@id = 'bodyContent'] | ||
3 | strip_id_or_class: editsection | ||
4 | #strip_id_or_class: toc | ||
5 | strip_id_or_class: vertical-navbox | ||
6 | strip: //table[@id='toc'] | ||
7 | strip: //div[@id='catlinks'] | ||
8 | strip: //div[@id='jump-to-nav'] | ||
9 | strip: //div[@class='thumbcaption']//div[@class='magnify'] | ||
10 | strip: //table[@class='navbox'] | ||
11 | strip: //table[contains(@class, 'infobox')] | ||
12 | strip: //div[@class='dablink'] | ||
13 | strip: //div[@id='contentSub'] | ||
14 | strip: //table[contains(@class, 'metadata')] | ||
15 | strip: //*[contains(@class, 'noprint')] | ||
16 | strip: //span[@title='pronunciation:'] | ||
17 | prune: no | ||
18 | tidy: no | ||
19 | test_url: http://en.wikipedia.org/wiki/Christopher_Lloyd \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/standard/index.php b/inc/3rdparty/site_config/standard/index.php deleted file mode 100644 index a3d5f739..00000000 --- a/inc/3rdparty/site_config/standard/index.php +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | <?php | ||
2 | // this is here to prevent directory listing over the web | ||
3 | ?> \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/standard/version.php b/inc/3rdparty/site_config/standard/version.php deleted file mode 100644 index e61807ed..00000000 --- a/inc/3rdparty/site_config/standard/version.php +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | <?php | ||
2 | return 1; \ No newline at end of file | ||