init.php 693 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class LJ_No_LastModified extends Plugin {
  3. private $host;
  4. function about() {
  5. return array(1.0,
  6. "Force unconditional HTTP requests for Livejournal (also disables cache)",
  7. "fox");
  8. }
  9. function init($host) {
  10. $this->host = $host;
  11. $host->add_hook($host::HOOK_FETCH_FEED, $this);
  12. }
  13. function hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $idk, $auth_login, $auth_pass) {
  14. if (mb_strpos($fetch_url, "livejournal.com/data") !== FALSE) {
  15. $feed_data = fetch_file_contents([
  16. "url" => $fetch_url,
  17. "login" => $auth_login,
  18. "pass" => $auth_pass,
  19. "last_modified" => ""
  20. ]);
  21. return $feed_data;
  22. }
  23. }
  24. function api_version() {
  25. return 2;
  26. }
  27. }