Plugin Directory

Changeset 1492373


Ignore:
Timestamp:
09/08/2016 09:27:40 AM (10 years ago)
Author:
wpicalavailability
Message:

Added file_get_contents as the main way to grab feeds, with cURL as a fallback method.

Location:
wp-ical-availability
Files:
325 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-ical-availability/trunk/include/class.iCalReader.php

    r1453941 r1492373  
    5353            return false;
    5454        }   
    55                
    56         $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
    57         $curl_handle=curl_init();
    58         curl_setopt($curl_handle, CURLOPT_USERAGENT, $agent);
    59         curl_setopt($curl_handle, CURLOPT_URL, $filename);
    60         curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 1);
    61         curl_setopt($curl_handle, CURLOPT_TIMEOUT, 2);
    62         curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
    63         curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE);
    64         curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
    6555       
    66         $contents = curl_exec($curl_handle);
     56        //try the easy way:
    6757       
    68         curl_close($curl_handle);
     58        if(!@$contents = file_get_contents($filename)){
     59             
     60            $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
     61            $curl_handle=curl_init();
     62            curl_setopt($curl_handle, CURLOPT_USERAGENT, $agent);
     63            curl_setopt($curl_handle, CURLOPT_URL, $filename);
     64            curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 1);
     65            curl_setopt($curl_handle, CURLOPT_TIMEOUT, 2);
     66            curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
     67            curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE);
     68            curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
     69           
     70            $contents = curl_exec($curl_handle);
     71           
     72   
     73            curl_close($curl_handle);
     74        }
    6975
    7076        $lines = explode("\n", $contents);
  • wp-ical-availability/trunk/readme.txt

    r1477916 r1492373  
    44Requires at least: 3.0
    55Tested up to: 4.6
    6 Stable tag: 0.6
     6Stable tag: 0.7
    77
    88This calendar imports an iCal feed from an external website, like Airbnb, and shows the availability based on that feed.
     
    1010== Description ==
    1111
    12 Show the availability of your holiday home by just importing an iCal feed. Is your holiday home listed on Airbnb, FlipKey or any other vacation rental site? Use this calendar plugin to show the availability on your WordPress website. Add the iCal feed, sit back and relax!
     12Show the availability of your holiday home by just importing an iCal feed. Is your holiday home listed on Airbnb, any other site or are you using Google Calendar? Use this calendar plugin to show the availability on your WordPress website. Add the iCal feed, sit back and relax!
    1313
    1414= Features of the Free version =
     
    6767== Changelog ==
    6868
     69= 0.7 =
     70* Added file_get_contents as the main way to grab feeds, with cURL as a fallback method.
     71
    6972= 0.6 =
    7073* Added follow redirects to curl
     
    8992== Upgrade Notice ==
    9093
     94= 0.7 =
     95* Added file_get_contents as the main way to grab feeds, with cURL as a fallback method.
     96
    9197= 0.6 =
    9298* Added follow redirects to curl
  • wp-ical-availability/trunk/wp-ical-availability.php

    r1453941 r1492373  
    44 * Plugin URI:  http://www.wpicalavailability.com
    55 * Description: WP iCal Availability
    6  * Version:     0.6
     6 * Version:     0.7
    77 * Author:      WP iCal Availability
    88 * Author URI:  http://www.wpicalavailability.com
Note: See TracChangeset for help on using the changeset viewer.