Changeset 451880
- Timestamp:
- 10/17/2011 08:26:02 AM (14 years ago)
- Location:
- everpress/trunk
- Files:
-
- 2 edited
-
everpress.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
everpress/trunk/everpress.php
r375140 r451880 3 3 /* 4 4 Plugin Name: EverPress 5 Plugin URI: http:// www.rsc-ne-scotland.org.uk/mashe/everpress-plugin/5 Plugin URI: http://mashe.hawksey.info/everpress-plugin/ 6 6 Description: EverPress allows Evernote users to automatic post their shared notebooks to WordPress. 7 7 Author: Martin Hawksey 8 Author URI: http:// www.rsc-ne-scotland.org.uk/mashe9 Version: 1.0. 28 Author URI: http://mashe.hawksey.info 9 Version: 1.0.3 10 10 */ 11 11 … … 127 127 check_admin_referer('everpress-0', 'everpress-add'); 128 128 if (isset($_POST['ep_share_url'])){ 129 if ($this->test_ep_feed($this->get_feed_url($_POST['ep_share_url']))){ 129 $ep_detected_url = $this->get_feed_url($_POST['ep_share_url']); 130 if ($this->test_ep_feed($ep_detected_url)){ 130 131 $idx=sizeof($this->o["ep_feeds"]); 131 132 $this->o["ep_feeds"][$idx]["share_url"]=$_POST['ep_share_url']; 132 $this->o["ep_feeds"][$idx]["feed_url"]=$ this->get_feed_url($_POST['ep_share_url']);133 $this->o["ep_feeds"][$idx]["feed_url"]=$ep_detected_url; 133 134 $this->o["ep_feeds"][$idx]["last_crawl"]=mktime(); 134 135 $this->o["ep_feeds"][$idx]["last_refresh_feed"]=mktime(); … … 161 162 162 163 function get_feed_url($ep_share_url) { 163 $file = $this->get_file_contents($ep_share_url); 164 $re1='<link.*?((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))'; 165 if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4.$re5.$re6."/is", $file, $matches)){ 166 $httpurl1=$matches[1][0]; 164 $lookup_url = "http://ajax.googleapis.com/ajax/services/feed/lookup?v=1.0&q=".urlencode($ep_share_url); 165 $page = $this->get_file_contents($lookup_url); 166 $data = json_decode($page); 167 if ($data->responseStatus == 200){ 168 return $data->responseData->url; 167 169 } 168 return $httpurl1;169 170 } 170 171 … … 199 200 $rss->enable_cache(false); 200 201 $rss->init(); 202 //echo ($this->o["ep_feeds"][$key]["feed_url"]); 201 203 $updated = $rss->get_item()->get_item_tags('', 'pubDate'); 202 204 $last_update = strtotime($updated[0]["data"]); … … 261 263 break; 262 264 } 263 265 //$next = strtotime($pdate) + 60; 264 266 if (mktime() >= $next) return true; 265 267 else return false; -
everpress/trunk/readme.txt
r375145 r451880 3 3 Tags: evernote, rss, autoblogging, aggregation, post, automatic, posting 4 4 Requires at least: 2.5 5 Tested up to: 3.1.16 Stable tag: 1.0. 25 Tested up to: 2.9.1 6 Stable tag: 1.0.3 7 7 8 8 EverPress allows Evernote users to automatic post their shared notebooks to WordPress. … … 36 36 37 37 == Changelog == 38 **1.0.3** - improved notebook feed detection 39 38 40 **1.0.2** - minor update to take account of Evernotes new web interface 39 41
Note: See TracChangeset
for help on using the changeset viewer.