spelltox Posted February 5, 2012 Share Posted February 5, 2012 Hi guys, I'm developing a website (with little experience) that is providing info to customers, What it should actually do is query some external websites, retrieve some data from them, then display it to the user in nice formatted fashion. I've done such thing before in non-web programming languages (visual basic, etc), but never in PHP or such. I've downloaded some PHP framework that is able to parse html pages, but after some time that the script is running it is stopped and says that "script time limit exceeded". The problem is that i'm not sure if PHP is the right choice for this task. I'm using standard hosting account and don't want to purchase VPS or Dedicated server for this task. My questions are : 1. Is this possible ? 2. Which languages\technologies should i use ? 3. Security aspects. 4. Samples / Code snippets / Articles / Anything else that might help. Thanks, SpellTOx. Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/ Share on other sites More sharing options...
scootstah Posted February 6, 2012 Share Posted February 6, 2012 In what way are you "querying external websites?" Are you scraping them? Accessing external databases? Accessing an API or RSS feed? In any case, PHP should work fine. You can use set_time_limit() to increase the script execution time. Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1314996 Share on other sites More sharing options...
spelltox Posted February 6, 2012 Author Share Posted February 6, 2012 Hi, set_time_limit is not accessible to me because this is not my own server, but a hosting company. As for the external websites - i'm simply sending request and the parse the returned html. I wonder if php is the right choice, or maybe some other platform / combination. Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1315012 Share on other sites More sharing options...
scootstah Posted February 6, 2012 Share Posted February 6, 2012 Why do you think PHP is not the right choice? Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1315140 Share on other sites More sharing options...
spelltox Posted February 7, 2012 Author Share Posted February 7, 2012 Maybe it is ... I just don't know, If you say it is the right choice i'll take your word for it Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1315371 Share on other sites More sharing options...
spelltox Posted February 7, 2012 Author Share Posted February 7, 2012 Some other problem ... scraping the web pages take quite some time, so i need a way to run some background script that will do the scrapping and when done it can set some flag in my database. The question is : 1. how do i run that other script in the background ? 2. how do i let the user know that processing is done and show him the results ? Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1315509 Share on other sites More sharing options...
scootstah Posted February 7, 2012 Share Posted February 7, 2012 What do you mean "in the background"? I don't know how you are going about scraping a page, but it really shouldn't take more than a second or two at most. You can use a cron job to run the script at specific intervals. Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1315571 Share on other sites More sharing options...
ManiacDan Posted February 7, 2012 Share Posted February 7, 2012 Answer received on devshed Closed. Link to comment https://forums.phpfreaks.com/topic/256457-is-php-the-right-choice-here/#findComment-1315582 Share on other sites More sharing options...
Recommended Posts