Skip to content

Commit

Permalink
possibility for sending cookies with feed updates
Browse files Browse the repository at this point in the history
this is used for Tumblr, which now redirects to a GDPR approval page in the EU
just supply two cookies in cookies.txt, namely "pfp" and "pfu"
the file is in Netscape format (see http://www.cookiecentral.com/faq/#3.5)
the file needs to be writable for the update process
  • Loading branch information
RomanSixty committed May 20, 2018
1 parent c1a4399 commit 0da2b16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,5 @@ fof.log
fof-install.log
*.db
*~

cookies.txt
.idea
4 changes: 4 additions & 0 deletions cookies.txt.dist
@@ -0,0 +1,4 @@
# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

9 changes: 9 additions & 0 deletions fof-main.php
Expand Up @@ -846,6 +846,15 @@ function fof_parse($url)

$pie = fof_new_parser();
$pie->set_feed_url($url);

// do we have a cookie file?
if ( is_readable ( $cookiestxt = dirname(__FILE__) . '/cookies.txt' ) ) {
$pie->set_curl_options(array(
CURLOPT_COOKIEFILE => $cookiestxt,
CURLOPT_COOKIEJAR => $cookiestxt
) );
}

$pie->init();

/* A feed might contain data before the <?xml declaration, which will cause
Expand Down

0 comments on commit 0da2b16

Please sign in to comment.