Changeset 2015568
- Timestamp:
- 01/19/2019 10:12:34 PM (7 years ago)
- Location:
- zotero-notes/trunk
- Files:
-
- 4 edited
-
class.zotero-notes-dataCollector.php (modified) (2 diffs)
-
class.zotero-notes-referencesList.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
zotero-notes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zotero-notes/trunk/class.zotero-notes-dataCollector.php
r2015524 r2015568 57 57 58 58 /** 59 * First, we try with wikipedia Citroid API, but the result may be incomplete... 60 * However, it's very useful for PDF documents. 59 * Let's fetch the Zotero reference. If it exists in cache, no need to retrieve it (if not too old). 61 60 */ 62 61 63 62 $curl_url_zotero = self::ZOTERO_API_URL . "/users/" . $zotero_id . "/items/" . $item_id . "?v=" . self::ZOTERO_API_VERSION; 64 $zotero_response = self::_my_curl($curl_url_zotero, $zotero_key); 63 64 /* Is it in cache? */ 65 $transient_key = $item_id . ":" . $zotero_id; 66 if ( false === ( $zotero_response = get_transient( $transient_key ) ) ) { 67 // It wasn't there, so regenerate the data and save the transient 68 $zotero_response = self::_my_curl($curl_url_zotero, $zotero_key); 69 set_transient( $transient_key, $zotero_response, 12 * HOUR_IN_SECONDS ); 70 } 65 71 66 72 // Then we parse the response to find the information … … 92 98 curl_setopt($curl, CURLOPT_USERAGENT, filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')); // TNO 93 99 94 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Zotero-API-Key: " . $zotero_key ));100 curl_setopt($curl, CURLOPT_HTTPHEADER, array("Zotero-API-Key: " . $zotero_key, "Cache-Control: max-age=3600; public")); 95 101 96 102 $response = curl_exec( $curl ); // TNO -
zotero-notes/trunk/class.zotero-notes-referencesList.php
r2015524 r2015568 21 21 */ 22 22 23 private $_post_id; 23 24 private $_liste_references = array(); 24 25 -
zotero-notes/trunk/readme.txt
r2015524 r2015568 51 51 == Changelog == 52 52 53 = 1.0.1 = 54 Some caching added (to prevent too frequent curl calls). 55 53 56 = 1.0.0 = 54 57 * First public release -
zotero-notes/trunk/zotero-notes.php
r2008431 r2015568 19 19 */ 20 20 21 22 21 public function __construct() { 23 22 … … 46 45 new zotero_notes_ReferencesList(); 47 46 } 47 48 48 49 } 49 50
Note: See TracChangeset
for help on using the changeset viewer.