Menu

Inserting information from crawl into a mysql database

Help
Anonymous
2013-08-26
2013-08-28
  • Anonymous

    Anonymous - 2013-08-26

    I would like to configure this to just crawl and put the information into a database on my server. Has anyone does this yet and can you tell me if I just edit the output.php file with the codes to insert into by database tables? or where to I put that code so I do not get a printout of the information?

     

    Last edit: Anonymous 2013-11-19
  • Anonymous

    Anonymous - 2013-08-27

    Hi,

    simply do a INSERT-query inside the handleDocumentInfo()-method instead of printing out the information.

    Also take a look at this thread:
    http://sourceforge.net/p/phpcrawl/discussion/307696/thread/de044f63/

     
  • Anonymous

    Anonymous - 2013-08-28

    ok so I put in the following code where you said, I want more data stored but I am only using 2 variables to get it working. The code below is what I am using and all it is doing is adding blank lines to my table under the id column with auto increment. The url and host columns are still empty.

    Is the Public Properties the right place to get the values?

    Here is the code, I know it is connecting to db because it is adding id #'s

    $sql="INSERT INTO data (url, host)
    VALUES
    ('$_POST[url]','$_POST[host]')";

    *UPDATE* FINALLY FIGURED IT OUT

    This is the code needed:

    $sql="INSERT INTO data (url, status_code)
    VALUES ('$DocInfo->url','$DocInfo->http_status_code')";

    Now I can add more and see if it will give me the data I am looking for :)

     

    Last edit: Anonymous 2013-08-28
  • Anonymous

    Anonymous - 2013-08-28

    Hi!

    Exactly!

    Just look at the docu for the DocumentInfo-class for all avaliable information of a crawled website: http://phpcrawl.cuab.de/classreferences/PHPCrawlerDocumentInfo/overview.html

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.