# A little challenge



## titanicsaled (May 16, 2013)

This challenge was posted on raspberrypi.org by mythicbeasts (a hosting company). The purpose of completing this challenge is to be able to apply for a job there at the end but I thought I'd post it here for people to try for fun.

Basically its an arithmetic sum which you have to complete in 3/4 seconds but obviously that's impossible so there has to be another way! I haven't succeeded to complete it yet :/

http://www.mythic-beasts.com/cgi-bin/job.pl

Give it your best shot 

btw Hello everyone, this is my first post here!


----------



## Retry (May 16, 2013)

I could have got it if my browser could have send the request any faster.


----------



## mnpeep (May 16, 2013)

You can easily write a script to parse the text and calculate what the value should be, THEN input it into the form and submit it. I'll see what I can do.


----------



## titanicsaled (May 16, 2013)

You could, but I think the intended solution is different. If you look at the source of the page you will notice that there is a hidden input field which contains something encrypted. I think that encrypted string is the answer. I just don't know what encryption it is.


----------



## 5n1p (May 16, 2013)

this python code is working:


```
import urllib
a = urllib.urlopen('http://www.mythic-beasts.com/cgi-bin/job.pl', 'r')
b = a.read().split('Evaluate')[1].split(',')[0].strip()
print b
print eval(b.replace(' ',''))
```


----------



## titanicsaled (May 16, 2013)

I have no experience of python whatsoever, could you explain what this code does please?


----------



## 5n1p (May 16, 2013)

It tells you the number to input in that form, but i don't know how to make script for that part 

but ok:

- a opens url(obviously)

- b read html and strips it to math expression

- print b line you dont need actualy it prints math expression

- print eval(b.replace(' ',''), this line print result

it means

b.replace(' ','') to lose spaces from expression 

and eval() make a number from  math expression

but all this is in last line alone.

Now you need to add how to submit it auto and that is it.

I'm not a programmer just learning to code from time to time, so don't expect to much from me 

Now you login to your VPS type python and copy this code.

Sorry for bad English.


----------



## titanicsaled (May 16, 2013)

Wow, that works great. Just would need to figure out how to post the information to the page


----------

