Plugin Directory

Changeset 451880


Ignore:
Timestamp:
10/17/2011 08:26:02 AM (14 years ago)
Author:
mhawksey
Message:
 
Location:
everpress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • everpress/trunk/everpress.php

    r375140 r451880  
    33/*
    44Plugin Name: EverPress
    5 Plugin URI: http://www.rsc-ne-scotland.org.uk/mashe/everpress-plugin/
     5Plugin URI: http://mashe.hawksey.info/everpress-plugin/
    66Description: EverPress allows Evernote users to automatic post their shared notebooks to WordPress. 
    77Author: Martin Hawksey
    8 Author URI: http://www.rsc-ne-scotland.org.uk/mashe
    9 Version: 1.0.2
     8Author URI: http://mashe.hawksey.info
     9Version: 1.0.3
    1010*/
    1111
     
    127127                    check_admin_referer('everpress-0', 'everpress-add');
    128128                    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)){
    130131                            $idx=sizeof($this->o["ep_feeds"]);
    131132                            $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;
    133134                            $this->o["ep_feeds"][$idx]["last_crawl"]=mktime();
    134135                            $this->o["ep_feeds"][$idx]["last_refresh_feed"]=mktime();
     
    161162       
    162163        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;
    167169            }
    168             return $httpurl1;
    169170        }
    170171       
     
    199200            $rss->enable_cache(false);
    200201            $rss->init();
     202            //echo ($this->o["ep_feeds"][$key]["feed_url"]);
    201203            $updated = $rss->get_item()->get_item_tags('', 'pubDate');
    202204            $last_update = strtotime($updated[0]["data"]);
     
    261263                        break;
    262264                }
    263                
     265               //$next = strtotime($pdate) + 60;
    264266                if (mktime() >= $next) return true;
    265267                else return false;
  • everpress/trunk/readme.txt

    r375145 r451880  
    33Tags: evernote, rss, autoblogging, aggregation, post, automatic, posting
    44Requires at least: 2.5
    5 Tested up to: 3.1.1
    6 Stable tag: 1.0.2
     5Tested up to: 2.9.1
     6Stable tag: 1.0.3
    77
    88EverPress allows Evernote users to automatic post their shared notebooks to WordPress.
     
    3636
    3737== Changelog ==
     38**1.0.3** - improved notebook feed detection
     39
    3840**1.0.2** - minor update to take account of Evernotes new web interface
    3941
Note: See TracChangeset for help on using the changeset viewer.