]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/FlattrItem.class.php
WHAT. A. BIG. REFACTOR. + new license (we moved to MIT one)
[github/wallabag/wallabag.git] / inc / 3rdparty / FlattrItem.class.php
index 711b4ee0787aa6f906419bf642ab7969a4e06581..5cf9e5fce5a31d1063f1505fd97eb9325b02ad5e 100644 (file)
@@ -1,25 +1,32 @@
 <?php
-/* 
-* Class for Flattr querying
-*/
-class FlattrItem {
+/**
+ * wallabag, self hostable application allowing you to not miss any content anymore
+ *
+ * @category   wallabag
+ * @author     Nicolas LÅ“uillet <nicolas@loeuillet.org>
+ * @copyright  2013
+ * @license    http://opensource.org/licenses/MIT see COPYING file
+ */
 
+class FlattrItem
+{
     public $status;
     public $urltoflattr;
     public $flattrItemURL;
     public $numflattrs;
 
-    public function checkItem($urltoflattr,$id) {
-        $this->cacheflattrfile($urltoflattr, $id);
+    public function checkItem($urltoflattr, $id)
+    {
+        $this->_cacheflattrfile($urltoflattr, $id);
         $flattrResponse = file_get_contents(CACHE . "/flattr/".$id.".cache");
         if($flattrResponse != FALSE) {
             $result = json_decode($flattrResponse);
-                       if (isset($result->message)){
+            if (isset($result->message)) {
                 if ($result->message == "flattrable") {
                     $this->status = FLATTRABLE;
                 }
             } 
-               elseif (is_object($result) && $result->link) {
+            elseif (is_object($result) && $result->link) {
                 $this->status = FLATTRED;
                 $this->flattrItemURL = $result->link;
                 $this->numflattrs = $result->flattrs;
@@ -33,7 +40,8 @@ class FlattrItem {
         }
     }
 
-    private function cacheflattrfile($urltoflattr, $id) {
+    private function _cacheflattrfile($urltoflattr, $id)
+    {
         if (!is_dir(CACHE . '/flattr')) {
             mkdir(CACHE . '/flattr', 0777);
         }