summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-06-28 10:08:49 +0300
committerAndrew Dolgov <[email protected]>2018-06-28 10:08:49 +0300
commit0c29d48d0063f108e6f8c8f2024ada7c27aa6ddc (patch)
tree29386561157c4988c1f465fc2c90c22527779e17
initial
-rw-r--r--init.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/init.php b/init.php
new file mode 100644
index 0000000..a0c1b07
--- /dev/null
+++ b/init.php
@@ -0,0 +1,35 @@
+<?php
+class LJ_No_LastModified extends Plugin {
+ private $host;
+
+ function about() {
+ return array(1.0,
+ "Force unconditional HTTP requests for Livejournal (also disables cache)",
+ "fox");
+ }
+
+ function init($host) {
+ $this->host = $host;
+
+ $host->add_hook($host::HOOK_FETCH_FEED, $this);
+ }
+
+ function hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $idk, $auth_login, $auth_pass) {
+ if (mb_strpos($fetch_url, "livejournal.com/data") !== FALSE) {
+
+ $feed_data = fetch_file_contents([
+ "url" => $fetch_url,
+ "login" => $auth_login,
+ "pass" => $auth_pass,
+ "last_modified" => ""
+ ]);
+
+ return $feed_data;
+ }
+ }
+
+ function api_version() {
+ return 2;
+ }
+
+}