I'm very new to RSS. I was given a URL that starts with "feed:". I
want to be able to open this and read in its content into a PHP
program to produce a report. I'm not interested in converting it to
HTML.
Question: Is a URL that starts with feed: output XML?
Question: How do I open a feed: URL in PHP and parse it?
Thanks!
Edward 8 1875
On Nov 29, 7:14 pm, eastcoastguyz <eastcoastg...@hotmail.comwrote:
I'm very new to RSS. I was given a URL that starts with "feed:". I
want to be able to open this and read in its content into a PHP
program to produce a report. I'm not interested in converting it to
HTML.
Question: Is a URL that starts with feed: output XML?
Question: How do I open a feed: URL in PHP and parse it?
Thanks!
Edward
Remove the "feed:" portion and replace it with http://... and make it
a standard url. It should work.
Yes, it should be an xml file.
--
Kailash Nadh | http://kailashnadh.name
eastcoastguyz wrote:
I'm very new to RSS. I was given a URL that starts with "feed:". I
want to be able to open this and read in its content into a PHP
program to produce a report. I'm not interested in converting it to
HTML.
Question: Is a URL that starts with feed: output XML?
Question: How do I open a feed: URL in PHP and parse it?
Thanks!
Edward
Open it using fopen, file_get_contects or curl, and read it using
simpleXML, or XMLReader.
On Nov 29, 3:39 pm, Kailash Nadh <kailash.n...@gmail.comwrote:
On Nov 29, 7:14 pm,eastcoastguyz<eastcoastg...@hotmail.comwrote:
I'm very new to RSS. I was given a URL that starts with "feed:". I
want to be able to open this and read in its content into a PHP
program to produce a report. I'm not interested in converting it to
HTML.
Question: Is a URL that starts with feed: output XML?
Question: How do I open a feed: URL in PHP and parse it?
Thanks!
Edward
Remove the "feed:" portion and replace it with http://... and make it
a standard url. It should work.
Yes, it should be an xml file.
--
Kailash Nadh |http://kailashnadh.name
Thank you! I see now. What really confused me was that wget and curl
said they didn't support "feed:".
On Nov 30, 1:23 am, taps128 <nstje...@gmail.comwrote:
eastcoastguyzwrote:
I'm very new to RSS. I was given a URL that starts with "feed:". I
want to be able to open this and read in its content into a PHP
program to produce a report. I'm not interested in converting it to
HTML.
Question: Is a URL that starts with feed: output XML?
Question: How do I open a feed: URL in PHP and parse it?
Thanks!
Edward
Open it using fopen, file_get_contects or curl, and read it using
simpleXML, or XMLReader.
Thanks for your posting.
I looked at the example for simpleXML on the php.net web site. I was
able to get the first example working. So I'm starting to understand
how this might work.
I have some questions. That example.php looks to be XML with a PHP
envelope (for lack of a better term) around it and then it has a call
to XML with "XML;". Since I'm new to this, that is a little confusing
as an example. How would that example be if it was reading from a
rss.xml file? And what about the "XML;" call?
Thanks everyone!
Edward
On Fri, 30 Nov 2007 08:59:50 +0100, eastcoastguyz
<ea***********@hotmail.comwrote:
On Nov 30, 1:23 am, taps128 <nstje...@gmail.comwrote:
>eastcoastguyzwrote:
I'm very new to RSS. I was given a URL that starts with "feed:". I
want to be able to open this and read in its content into a PHP
program to produce a report. I'm not interested in converting it to
HTML.
Question: Is a URL that starts with feed: output XML?
Question: How do I open a feed: URL in PHP and parse it?
Thanks!
Edward
Open it using fopen, file_get_contects or curl, and read it using simpleXML, or XMLReader.
Thanks for your posting.
I looked at the example for simpleXML on the php.net web site. I was
able to get the first example working. So I'm starting to understand
how this might work.
I have some questions. That example.php looks to be XML with a PHP
envelope (for lack of a better term) around it
Just to output with PHP script. This will offcourse not be visible when it
is requested.
and then it has a call
to XML with "XML;". Since I'm new to this, that is a little confusing
as an example. How would that example be if it was reading from a
rss.xml file? And what about the "XML;" call?
Check the manual for heredoc syntax.
--
Rik Wasmus
eastcoastguyz wrote:
Thank you! I see now. What really confused me was that wget and curl
said they didn't support "feed:".
This is a deliberate choice of the designers of the URI scheme -- indeed
it's the whole point of it. They wanted a way to reference a feed in such
a way that browsers would not attempt to open it.
It's an entirely broken idea. The feed should simply be marked with the
correct MIME type and left up to the user's system to decide whether it
should be opened in the browser or a more specialist application.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 5 days, 17:59.]
Sharing Music with Apple iTunes http://tobyinkster.co.uk/blog/2007/1...tunes-sharing/
eastcoastguyz wrote:
On Nov 30, 1:23 am, taps128 <nstje...@gmail.comwrote:
>eastcoastguyzwrote:
>>I'm very new to RSS. I was given a URL that starts with "feed:". I want to be able to open this and read in its content into a PHP program to produce a report. I'm not interested in converting it to HTML. Question: Is a URL that starts with feed: output XML? Question: How do I open a feed: URL in PHP and parse it? Thanks! Edward
Open it using fopen, file_get_contects or curl, and read it using simpleXML, or XMLReader.
Thanks for your posting.
I looked at the example for simpleXML on the php.net web site. I was
able to get the first example working. So I'm starting to understand
how this might work.
I have some questions. That example.php looks to be XML with a PHP
envelope (for lack of a better term) around it and then it has a call
to XML with "XML;". Since I'm new to this, that is a little confusing
as an example. How would that example be if it was reading from a
rss.xml file? And what about the "XML;" call?
Thanks everyone!
Edward
It's just a string. You can load an xml file directly from a file if you
want.
Like this:
$rss=simplexml_load_file('http://www.somesite.com/rss.xml');
Now you have a SimpleXML object named $rss which you can use to iterate.
Note that this will work faublosly over small files, but the larger the
file tho more time SimpleXML will take to read it. That's because
SimpleXML alows you to navigate the xml tree as you wish, foroward and
backwards how many times you like. To do so it first builds a tree of
the file in the servers memory. For big files it takes a lot of time to
do so.
If you need just tu parse the file, I'd suggest you to use XMLReader
which is way faster to use.
On Nov 30, 8:14 am, taps128 <nstje...@gmail.comwrote:
eastcoastguyzwrote:
On Nov 30, 1:23 am, taps128 <nstje...@gmail.comwrote:
eastcoastguyzwrote: I'm very new to RSS. I was given a URL that starts with "feed:". I want to be able to open this and read in its content into a PHP program to produce a report. I'm not interested in converting it to HTML. Question: Is a URL that starts with feed: output XML? Question: How do I open a feed: URL in PHP and parse it? Thanks! Edward
Open it using fopen, file_get_contects or curl, and read it using
simpleXML, or XMLReader.
Thanks for your posting.
I looked at the example for simpleXML on the php.net web site. I was
able to get the first example working. So I'm starting to understand
how this might work.
I have some questions. That example.php looks to be XML with a PHP
envelope (for lack of a better term) around it and then it has a call
to XML with "XML;". Since I'm new to this, that is a little confusing
as an example. How would that example be if it was reading from a
rss.xml file? And what about the "XML;" call?
Thanks everyone!
Edward
It's just a string. You can load an xml file directly from a file if you
want.
Like this:
$rss=simplexml_load_file('http://www.somesite.com/rss.xml');
Now you have a SimpleXML object named $rss which you can use to iterate.
Note that this will work faublosly over small files, but the larger the
file tho more time SimpleXML will take to read it. That's because
SimpleXML alows you to navigate the xml tree as you wish, foroward and
backwards how many times you like. To do so it first builds a tree of
the file in the servers memory. For big files it takes a lot of time to
do so.
If you need just tu parse the file, I'd suggest you to use XMLReader
which is way faster to use.
Thanks!
What size is considered large? The RSS is running at about 260k. Thank
you.
Edward This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ian justice |
last post by:
Before i post actual code, as i need a speedyish reply.
Can i first ask if anyone knows off the top of their head, if there is
a likely obvious cause to the following problem.
For the moment i've...
|
by: David Morgenthaler |
last post by:
How does one overide the iterator implied by the construct "for line
in file:"?
For example, suppose I have a file containing row,col pairs on each
line, and I wish to write a subclass of file...
|
by: Peter Hansen |
last post by:
The term "mock filesystem" refers to code allowing unit
or acceptance tests to create, read and write, and manipulate
in other ways "virtual" files, without any actual disk
access. Everything is...
|
by: Gustaf Liljegren |
last post by:
I'm using xml.sax.parseString to read an XML file. The XML file contains
a few words in Russian, and is encoded in UTF-8 using C#. In the example
below, MyParser() is my SAX ContentHandler class....
|
by: John Baker |
last post by:
Hi:
Does "On Open" code execute before or after related data is loaded? I want to test before
the form appears on the screen to see if there is any data in the queryresult, and if
there is not...
| |
by: Trevor Andrew |
last post by:
Hi There,
I have posted something previously regarding this issue, but I think I have
some more concise questions to ask, and would like to get further feedback
on this issue.
Firstly the...
|
by: taurin423 |
last post by:
I am working on integrating RSS reading into my ASP.NET web
application. So far I have it working just fine with showing the full
feed, but I'm not sure how to let it handle which items have been...
|
by: Greg C. |
last post by:
I tried tackling this problem about 6 months ago, but after going
almost completely insane I gave up, since my news feed seemed to
display just fine anyways. However, in an effort to have my feeds...
|
by: GazK |
last post by:
I have been using an xml parsing script to parse a number of rss feeds
and return relevant results to a database. The script has worked well
for a couple of years, despite having very crude...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |