-5

I have installed the tiny tiny rss on to my computer (Windows) and also have Xampp installed (localhost).

I want to be able to use PHP to extract data from the Tiny tiny RSS webpage.

I have tried this it which just opens the front page:

<?php
$homepage = file_get_contents('my install tiny tiny rss url');
echo $homepage;
?>

But how do I login and extract the data.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
user3065043
  • 57
  • 2
  • 9
  • You can't do that with file_get_contents. You need CURL for that. – putvande Dec 16 '13 at 13:20
  • You'll need to give more information and example for people to be able to give you an answer. By the sound of it though you are trying to automatically login to a website and page scrape it, you might consider using [cURL](http://www.php.net/manual/en/ref.curl.php) for this as it can maintain cookie jars. – AeroX Dec 16 '13 at 13:21
  • How you do that. I suggest learning how to use CURL. http://php.net/curl – putvande Dec 16 '13 at 13:23
  • 1
    It is possible to use `file_get_contents` in place of cURL. See [this post](http://stackoverflow.com/questions/11064980/php-curl-vs-file-get-contents) – Goldentoa11 Dec 16 '13 at 13:23
  • can some one give the example for it – user3065043 Dec 16 '13 at 13:23
  • @Goldentoa11. Not always. And you can't login etc. – putvande Dec 16 '13 at 13:23
  • @putvande It seems that his code sample would be one of those situations that you can. It appears to be a GET request (though I could be wrong), and you should use `file_get_contents` over cURL in GET situations. – Goldentoa11 Dec 16 '13 at 13:50

1 Answers1

5

You can use cURL to send post data and headers. To login you need to replicate the exact data exchange between the client and the server.

Check this answer for some examples:

How do I submit POST data using PHP and cURL?

Php : sending cookie in curl Request

Community
  • 1
  • 1
ProGM
  • 6,949
  • 4
  • 33
  • 52
  • 1
    This answer gets my vote. Without more information from the OP the best we can do it to tell you the best tools to look into. The OP will need to search and read the manuals for how to do what he wants, if he then gets stuck and has a question with an example of what he tried I'm sure he'll get much more help. – AeroX Dec 16 '13 at 13:30