forked from PressForward/pressforward
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First implementation for ticket PressForward#994
Simple GET request to the archive.org server
- Loading branch information
1 parent
503c019
commit 8fa6fe6
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Created by IntelliJ IDEA. | ||
* User: yoann | ||
* Date: 2019-04-09 | ||
* Time: 10:08 | ||
*/ | ||
|
||
namespace PressForward\Core\Utility; | ||
|
||
|
||
class Internet_Archive { | ||
function __construct() { | ||
|
||
} | ||
|
||
/** | ||
* @param $url The URL of a page we want to be saved on archive.org | ||
* | ||
* @return bool|string TRUE if successful, FALSE if not | ||
*/ | ||
function send_request_to_archive_dot_org( $url ) { | ||
pf_log("Send to archive.org!"); | ||
$ch = curl_init( 'https://web.archive.org/save/' . $url ); | ||
$result = curl_exec($ch); | ||
|
||
return $result; | ||
} | ||
} |