barolet / kovans-ogbot

Automatically exported from code.google.com/p/kovans-ogbot
0 stars 0 forks source link

Galaxietool integration #131

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

GalaxieTool is an online database that you can set-up for your alliance. It
is basically a (legal cheat) huge interlinked collection of all solar
systems, esp reports etc. The databases use MySQL.

It would be great if you could make the bot either:

A) dump all espionage reports to a text file which can then be manually
uploaded
B) automatically upload the esp. reps

Also, if it could dump any solar systems into the text file as well that
would be awesome. These can also be uploaded manually.

Thanks

Original issue reported on code.google.com by avatar.h...@gmail.com on 22 Apr 2007 at 5:42

GoogleCodeExporter commented 8 years ago

Original comment by jsceballos on 3 Jun 2007 at 2:12

GoogleCodeExporter commented 8 years ago
I like the idea. That's why I opened the galaxytool/secret/galaxyplugin.php 
file and
read how you should access it. The file looks like something I like to call 
"ugly
hack" that is usually a result of upgraded software without previous thinking on
making the software upgradeable (happens to everybody once your software starts 
to
grow too fast).

Here's what I read and therefore the interface for the galaxyplugin. Once you 
have
the galaxytool URL, username and password, all you have to do is POST the 
following
data to that URL.

 * Identification

    user=<username>
    password=<password>

 * Usecase 1: Statistics

    typ=stats
    content=<statistics frame content>
    who={0: playerstats, 1: allystats}
    what={0: points, 1: fleet, 2: research}

 * Usecase 2: Galaxy view

    typ=galaxy
    content=<galaxy view frame content>
    galaxy=<galaxy>
    system=<system>

 * Usecase 3: Spy reports

    typ=reports
    content=<message frame content>

 * Usecase 4: Alliance history

    typ=allyhistory
    content=<alliance frame content>

 * Usecase 5: no such thing ;)

I will try to find some time and make a python class that would do all this, so 
that
jsceballos could just connect the class to standard routines (and add galaxytool
config options). I guess that those statistics and alliance history stuff are
very-low priority since ogbot still doesn't touch those things (maybe in the 
future?).

Original comment by marjan3...@gmail.com on 3 Jun 2007 at 3:42

GoogleCodeExporter commented 8 years ago
Thanks for that marjan3010. 
I've already been looking to this, and the main problem is that AFAICT both
einlesen.php and galaxyplugin.php only accept as input not the HTML source of 
the
galaxy view or espionages, but the result of copy & paste from the browser.
Aditionally, I think they are prepared to accept pastes only in the format that 
the
most popular browsers copy them to the clipboard.
Correct me if I am wrong.

Original comment by jsceballos on 3 Jun 2007 at 3:55

GoogleCodeExporter commented 8 years ago
Hm. I didn't know that. I just checked-out the source of the plugin and grabbed 
this
data. If what you say is true (and I have no doubt about that), then maybe some 
XSL
Transform could be made that would "textify" the output of that frame and make 
it
look as if it were copy+pasted from the browser. I'll look into it a bit more, 
then.

Original comment by marjan3...@gmail.com on 3 Jun 2007 at 4:15

GoogleCodeExporter commented 8 years ago
Maybe a look at firefox galaxytool plugin can help? I suppose that it also has 
to 
deal with source html code, not copied text.

Original comment by perebo...@gmail.com on 5 Jun 2007 at 8:50

GoogleCodeExporter commented 8 years ago
This should go to feature requests forum at
http://www.createforum.com/phpbb/viewforum.php?f=2&mforum=kovansogbot, but I'm
leaving it here because I like this one.

Original comment by jsceballos on 9 Jun 2007 at 9:50

GoogleCodeExporter commented 8 years ago

Original comment by jsceballos on 9 Jun 2007 at 9:58

GoogleCodeExporter commented 8 years ago
I myself am a bit of a Pythonista and I added a tid-bit into the WebAdapter.py 
file
that simply dumps the espionage reports into a text file for manual uploading, 
but
this will only work for people running the source code. Galaxietool accepts the
textfile just fine.

just replace WebAdapter.py, run it (so it recompiles) then run the OGBot.py. 
Upload
'C:/reports.txt' when you're done. If you run *nix just look through 
WebAdapter.py
and look for the edits I made (highlighted at start and end with hashes) and 
change
the directory as you see fit.

Oh and I had a read of the code, and it looks elite :P

Original comment by avatar.h...@gmail.com on 9 Jun 2007 at 11:22

Attachments:

GoogleCodeExporter commented 8 years ago
Moved to 
http://kovansogbot.16.forumer.com/viewtopic.php?p=47

Original comment by jsceballos on 11 Jun 2007 at 2:31