
Show HN: AskToby.PHP – Open Source Search Engine Seeking Contributers - crispytx
hello, world<p>Over the past two weeks I&#x27;ve been working on building a really crude search engine (AskToby.PHP), and have just finished managing to hack together a working prototype. The prototype has tons of bugs, only looks good on one monitor size, but it runs! At the moment its running on a Virtual Private Server crawling along at about 18,000 sites a day, crawling only the homepage of each site. But I think it has the potential to run much faster on a home-web server as my VPS appears to have much less bandwidth than my personal internet service. Anyway... If anyone&#x27;s interested in working on a fun open source project hit me up.<p>You can check out Version 2 of AskToby.PHP running on my website here:<p>https:&#x2F;&#x2F;personalhomepage.xyz&#x2F;asktoby.html<p>And you can check out my hacked-together code here:<p>https:&#x2F;&#x2F;github.com&#x2F;crispytx&#x2F;asktoby.php<p>If anyone is interested in contributing, feel free to contact me:<p>chrispedatx@gmail.com
======
stephenr
Um.. Ok wow. I know we're supposed to not be negative. So.. let me be clear
I'm not trying to discourage you, so think of this as constructive criticism.

Firstly. Get a template system. It doesn't need to be complex. I use a simple
object that accepts variables, stores them in an associative array, and then
when you call it's render() method, it uses extract() to make those local
variables and does an include of the template file - which can then have
whatever _template_ logic you require (loops, ifs, etc).

Next up. Your DB connection is using hard-coded strings. Use some kind of
configuration for this. I'm very partial to environment variables, but it
could also be an ini file, an environment-specific PHP file, etc.

Um.. 3? I don't know where Im up to now. Anyway, your DB query in the search
results file is extremely naive and insecure. Look into parameterised queries.

4 I guess. Just looking a the above referenced query indicates that any given
site is limited to just 13 keywords. I realise this is likely a learning
experience but basically that isn't going to work for any meaningful sort of
results.

5? You have a cron script, and then make a http request to call something
else. Why? Just execute the script you need to run.

I think that'll do for now..

