471,071 Members | 3,839 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

parsing RSS feeds where allow_url_fopen=OFF on php 4.4.4??

I need to get, parse and display RSS feeds while having the ini setting,
allow_url_fopen = Off.

I used to use (in version 4.1) domxml_open_mem() but it's not longer
available in this verison for some reason - and cannot install pecl
extensions.

Any ideas? Any example scripts?

Thanks!!
Nov 18 '06 #1
5 3831
Paul wrote:
I need to get, parse and display RSS feeds while having the ini setting,
allow_url_fopen = Off.

I used to use (in version 4.1) domxml_open_mem() but it's not longer
available in this verison for some reason - and cannot install pecl
extensions.

Any ideas? Any example scripts?

Offload the URL retrieval from the server to the client?

The client would get the RSS XML via JavaScript, and
then it would pass it to your server as a file
upload, cookie, or form variable.
Nov 18 '06 #2
Paul wrote:
I need to get, parse and display RSS feeds while having the ini setting,
allow_url_fopen = Off.

I used to use (in version 4.1) domxml_open_mem() but it's not longer
available in this verison for some reason - and cannot install pecl
extensions.

Any ideas? Any example scripts?

Thanks!!

There are at least two ways to make an http connection in PHP without allow_url_fopen being enabled
(I've tried both of these; the second one seems to be slightly faster).
1. The cURL library: http://www.php.net/cURL
If your host has it installed. For example, Dreamhost has allow_url_fopen disabled and offers cURL
as a replacement.

2. The open-source Drupal CMS contains a very powerful HTTP function that has no other dependencies
within the Drupal code - meaning you can easily copy and re-use it elsewhere. You can see the
function here: http://api.drupal.org/api/HEAD/funct...l_http_request . This function uses
fsockopen().

--
Christoph Burschka
Nov 18 '06 #3
"Christoph Burschka" <ch****************@rwth-aachen.dewrote in message
news:4s************@mid.dfncis.de...
Paul wrote:
>I need to get, parse and display RSS feeds while having the ini setting,
allow_url_fopen = Off.

I used to use (in version 4.1) domxml_open_mem() but it's not longer
available in this verison for some reason - and cannot install pecl
extensions.

Any ideas? Any example scripts?

Thanks!!


There are at least two ways to make an http connection in PHP without
allow_url_fopen being enabled
(I've tried both of these; the second one seems to be slightly faster).
1. The cURL library: http://www.php.net/cURL
If your host has it installed. For example, Dreamhost has allow_url_fopen
disabled and offers cURL
as a replacement.

2. The open-source Drupal CMS contains a very powerful HTTP function that
has no other dependencies
within the Drupal code - meaning you can easily copy and re-use it
elsewhere. You can see the
function here: http://api.drupal.org/api/HEAD/funct...l_http_request
. This function uses
fsockopen().

--
Christoph Burschka
OK _ I got a handle to the file using cURL. However, for some reason,
domxml_open_file() is not working. I have verified the curl gets and and
display the xml file properly. I just need to rpocess it and format it the
way I want without the domxml_open_file().

Any ideas?
Nov 19 '06 #4
Paul schrieb:
"Christoph Burschka" <ch****************@rwth-aachen.dewrote in message
news:4s************@mid.dfncis.de...
>>Paul wrote:
>>>I need to get, parse and display RSS feeds while having the ini setting,
allow_url_fopen = Off.

I used to use (in version 4.1) domxml_open_mem() but it's not longer
available in this verison for some reason - and cannot install pecl
extensions.

Any ideas? Any example scripts?

Thanks!!


There are at least two ways to make an http connection in PHP without
allow_url_fopen being enabled
(I've tried both of these; the second one seems to be slightly faster).
1. The cURL library: http://www.php.net/cURL
If your host has it installed. For example, Dreamhost has allow_url_fopen
disabled and offers cURL
as a replacement.

2. The open-source Drupal CMS contains a very powerful HTTP function that
has no other dependencies
within the Drupal code - meaning you can easily copy and re-use it
elsewhere. You can see the
function here: http://api.drupal.org/api/HEAD/funct...l_http_request
. This function uses
fsockopen().

--
Christoph Burschka


OK _ I got a handle to the file using cURL. However, for some reason,
domxml_open_file() is not working. I have verified the curl gets and and
display the xml file properly. I just need to rpocess it and format it the
way I want without the domxml_open_file().

Any ideas?

Instead of domxml_open_file(), use domxml_open_mem().

http://de3.php.net/manual/en/functio...l-open-mem.php

That function will parse the XML it receives directly, instead of
loading it from a file. Since you have the file's contents from cURL,
just pass them to domxml_open_mem.

---
CB
Nov 21 '06 #5
"Christoph Burschka" <ch****************@rwth-aachen.dewrote in message
news:4s************@mid.dfncis.de...
Paul schrieb:
>"Christoph Burschka" <ch****************@rwth-aachen.dewrote in message
news:4s************@mid.dfncis.de...
>>>Paul wrote:

I need to get, parse and display RSS feeds while having the ini setting,
allow_url_fopen = Off.

I used to use (in version 4.1) domxml_open_mem() but it's not longer
available in this verison for some reason - and cannot install pecl
extensions.

Any ideas? Any example scripts?

Thanks!!

There are at least two ways to make an http connection in PHP without
allow_url_fopen being enabled
(I've tried both of these; the second one seems to be slightly faster).
1. The cURL library: http://www.php.net/cURL
If your host has it installed. For example, Dreamhost has allow_url_fopen
disabled and offers cURL
as a replacement.

2. The open-source Drupal CMS contains a very powerful HTTP function that
has no other dependencies
within the Drupal code - meaning you can easily copy and re-use it
elsewhere. You can see the
function here:
http://api.drupal.org/api/HEAD/funct...l_http_request . This
function uses
fsockopen().

--
Christoph Burschka


OK _ I got a handle to the file using cURL. However, for some reason,
domxml_open_file() is not working. I have verified the curl gets and and
display the xml file properly. I just need to rpocess it and format it
the way I want without the domxml_open_file().

Any ideas?
Instead of domxml_open_file(), use domxml_open_mem().

http://de3.php.net/manual/en/functio...l-open-mem.php

That function will parse the XML it receives directly, instead of loading
it from a file. Since you have the file's contents from cURL, just pass
them to domxml_open_mem.

---
CB
thanks - I'll give it a try.
Nov 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by diablo | last post: by
5 posts views Thread by Tamir Khason | last post: by
4 posts views Thread by Gérard Talbot | last post: by
9 posts views Thread by ankitdesai | last post: by
6 posts views Thread by giulianodammando | last post: by
1 post views Thread by JackM | last post: by
1 post views Thread by ojsimon | last post: by
4 posts views Thread by Hillbilly | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.