Plugin Directory

Changeset 674101


Ignore:
Timestamp:
02/27/2013 03:20:38 PM (13 years ago)
Author:
ondics
Message:

rreplaced curl with wordpress stuff

Location:
open-data-viewer-for-austria/tags/1.0.2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • open-data-viewer-for-austria/tags/1.0.2/ckanfunc.php

    r672938 r674101  
    44Plugin URI: http://ckan.de
    55Description: Open Data Viewer for Austria brings the full power of open data from Austria to your Wordpress site.
    6 Version: 1.0.1
     6Version: 1.0.2
    77Author: Ondics GmbH
    88Author URI: http://ondics.de
  • open-data-viewer-for-austria/tags/1.0.2/proxy.php

    r668365 r674101  
    11<?php
     2require( '../../../wp-load.php' );
     3
     4
    25// this proxy is needed because to get the ckan data from a foreign server
    36$url = urldecode(($_GET['url']));
    47$url = str_replace(" ","%20",$url);
    58if (strpos($url, "pop") !== FALSE) return ""; // http://www.heise.de/newsticker/meldung/cURL-auf-Abwegen-1800433.html
    6 $ch = curl_init();
    7 // URL to grab
    8 curl_setopt($ch, CURLOPT_URL, $url);
    9 curl_setopt($ch, CURLOPT_HEADER, 0);
    10 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    11 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    12 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
    13 $output = curl_exec($ch);
    14 curl_close($ch);
     9
     10$output = wp_remote_retrieve_body(wp_remote_get($url, array("user-agent" => "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0"))); // using a common useragent to prevent blocking from some server
    1511
    1612// this code converts to utf-8 when needed. But mb_check_encoding is critical code! http://de2.php.net/manual/de/function.mb-check-encoding.php
  • open-data-viewer-for-austria/tags/1.0.2/readme.txt

    r672938 r674101  
    1 === Open Data Viewer for Austria ===
     1=== Open Data Viewer for Austria ===
    22Contributors: ondics
    33Donate link: http://ondics.de
     
    55Requires at least: 3.3
    66Tested up to: 3.5.1
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    175175== Changelog ==
    176176
     177= 1.0.2 =
     178
     179* Replacing cUrl with WordPress stuff
     180
    177181= 1.0.1 =
    178182
Note: See TracChangeset for help on using the changeset viewer.