Quantcast

Jump to content


Photo

Autotrainer


  • Please log in to reply
25 replies to this topic

#1 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 12:45 PM

I'm just a bit confused about the progression of selecting which course you want.

coursesURL = 'http://www.neopets.c...ml?type=courses'
processURL = 'http://www.neopets.c..._training.phtml'
statusURL = 'http://www.neopets.c...tml?type=status'

courseData = urllib.urlencode({'type':Start, 'course_request':coursetype, 'pet_name': pet})

Now to select my course do I do.

selectcourse = urllib2.Request(courseURL, courseData, headers)

OR

selectcourse = urllib2.Request(processURL, headers)

with a refer of courseURL + post data.


Sorry if this is a bit confusing I'm not familiar with python.



Edit: I notice when I click the link to PAY for my training that I POST

'http://www.neopets.c..._name=MYPETNAME'

So I think that in order to pick my course I actually POST
'http://www.neopets.c..._name=MYPETNAME'
with refer from
'http://www.neopets.c...ml?type=courses'

Edited by Shrouded, 14 March 2012 - 12:49 PM.


#2 Pyro699

Pyro699
  • 1543 posts


Users Awards

Posted 14 March 2012 - 12:46 PM

You would get a lot of use from a real http wrapper library.

http://wwwsearch.sou....net/mechanize/

#3 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 12:51 PM

I thought mech was only compatible with Ruby :unsure: If not :cool:



Edit: After some fun in the sun and getting my tent for this weekend, I'm still wondering if you know which method I should be using?

Edited by Shrouded, 14 March 2012 - 02:12 PM.


#4 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 14 March 2012 - 02:44 PM

You should just do the process manually on your browser and sniff the data that's sent, you'd just need to replicate it then.

#5 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 03:12 PM

You should just do the process manually on your browser and sniff the data that's sent, you'd just need to replicate it then.


I was attempting to sniff it with "Tamper Data" add-on on firefox. Do you have skype or msn or uhh... anything haha

#6 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 14 March 2012 - 03:17 PM

I was attempting to sniff it with "Tamper Data" add-on on firefox. Do you have skype or msn or uhh... anything haha


Just use something like Live HTTP Headers for Firefox, it'll show you the URL, data and referrer you need to send.

#7 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 03:23 PM

I think I got it. I am pretty sure I was correct with

'http://www.neopets.c...se_type=COURSE pet_name=MYPETNAME'

and refer being

'http://www.neopets.c...ml?type=courses'


I'm testing now.

#8 Nymh

Nymh
  • Keeper of Secrets

  • 4626 posts


Users Awards

Posted 14 March 2012 - 03:26 PM

(I just wanted to jump in and fangirl all over this topic)

Posted Image

#9 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 03:27 PM

I'm doing this for you primarily. Only two or three people spoke up in interest, one of whom is my real life friend. Of course he's goes to UVa so he's lame.

Edit: It worked! I can login, check status of training, accept new course, and monitor timer now. I'm not quite sure if I want to add in the ability to buy codestones from a users shop or require them to be held in inventory.

Edited by Shrouded, 14 March 2012 - 03:29 PM.


#10 Nymh

Nymh
  • Keeper of Secrets

  • 4626 posts


Users Awards

Posted 14 March 2012 - 03:29 PM

I'm doing this for you primarily. Only two or three people spoke up in interest, one of whom is my real life friend. Of course he's goes to UVa so he's lame.

Edit: It worked! I can login, check status of training, accept new course, and monitor timer now. I'm not quite sure if I want to add in the ability to buy codestones from a users shop or require them to be held in inventory.


OMG

Posted Image

#11 Adam

Adam
  • Coffee God


  • 4771 posts


Users Awards

Posted 14 March 2012 - 03:33 PM

nymh will be your personal nympho for life if you add the ability to buy codestones.

#12 Nymh

Nymh
  • Keeper of Secrets

  • 4626 posts


Users Awards

Posted 14 March 2012 - 03:44 PM

nymh will be your personal nympho for life if you add the ability to buy codestones.


Nah, I stay pretty busy with Scot already :wub:

Besides I have SSW so I can just keep an ample supply stocked up if it doesn't have the ability to buy

BTW I am still

Posted Image

#13 Adam

Adam
  • Coffee God


  • 4771 posts


Users Awards

Posted 14 March 2012 - 03:47 PM

LOL..I hope you're not spazzing like that. Say hello so seizures.

#14 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 03:57 PM

Finding information about mechanize on the internet is difficult _-_

#15 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 14 March 2012 - 04:01 PM

http://wwwsearch.sou....net/mechanize/
http://wwwsearch.sou...hanize/doc.html
http://stockrt.githu...with-mechanize/

#16 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 04:06 PM

The documentation of the first two links seemed to be all over the damn place. The last link was very helpful. I think I finally got it all under control :x3:

#17 Nymh

Nymh
  • Keeper of Secrets

  • 4626 posts


Users Awards

Posted 14 March 2012 - 04:11 PM

Posted Image

#18 Neoquest

Neoquest
  • 1760 posts


Users Awards

Posted 14 March 2012 - 04:47 PM

You could have asked a lot of people here for an Auto Trainer, nymh. You didn't really need to wait several months for the offical one :p Making one with no GUI and doesn't need to buy from the wiz is a quick job.

Edited by Neoquest, 14 March 2012 - 04:49 PM.


#19 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 04:55 PM

You could have asked a lot of people here for an Auto Trainer, nymh. You didn't really need to wait several months for the offical one :p Making one with no GUI and doesn't need to buy from the wiz is a quick job.


Thanks for pooping on my parade...

#20 Nymh

Nymh
  • Keeper of Secrets

  • 4626 posts


Users Awards

Posted 14 March 2012 - 04:58 PM

You could have asked a lot of people here for an Auto Trainer, nymh. You didn't really need to wait several months for the offical one :p Making one with no GUI and doesn't need to buy from the wiz is a quick job.


I have done pretty much everything except formally advertising that I wanted one. I just didn't want to step on any toes. I'll remember this for the other programs I want... :whistling:

#21 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 14 March 2012 - 05:19 PM

C'est fini! At least I hope... I've gotten it to ask login details, which pet to train, manually list which courses you want to train in order, then it goes to courses page, submits request based on the list/pet, goes to status page, (still trying to work out finding remaining time left), waits period of time appropriate for my pet now, then theoretically should move on in the loop until the number of courses you have listed is finished.

Things I want to do tomorrow/before physics test/before camping:

Make sure I made it through the night training my new orange buzz from the pound in level
Detect time remaining on status page/ change timer appropriately
Create a "logged-in" check after the timer expires
Improve crappy manual list system with the fastest training algorithm
Have a first release

Edit: All-in-all I'd say it was pretty successful first attempt. Even if it took me several hours to create a product that could be replicated by programming staff in ~1 hour with better features, I'm still proud. My programming experience is low, especially in python.

Edited by Shrouded, 14 March 2012 - 05:21 PM.


#22 Inkheart

Inkheart
  • 268 posts

Posted 15 March 2012 - 11:03 PM

When's release? : )

#23 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 16 March 2012 - 05:05 AM

I'm studying for world's biggest physics test today and I'm going camping saturday/sunday. When I was first coding I didn't have enough NP to afford every codestone... After the physics test/grocery shopping tonight I'll finish it up into something usable by all hopefully. I hate being responsible for everything now. Why can't I be 12 and have free time?

#24 Nymh

Nymh
  • Keeper of Secrets

  • 4626 posts


Users Awards

Posted 16 March 2012 - 06:31 AM

Posted Image

On the bright side, you are taking physics which is another plus in my book

#25 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 16 March 2012 - 07:23 AM

Posted Image

On the bright side, you are taking physics which is another plus in my book


I just did course request for next semester. Thermal/Fluid engineering, Dynamics, Mechanics of Deformable Bodies, Applied Electrical Theory, Physics II, and Numerical Analysis(A proofs class I think? Mathematics minor course). Just when I thought this semester was the best semester ever.

Edited by Shrouded, 16 March 2012 - 07:24 AM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users