| Pages: [1] :: one page |
| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Histracko
|
Posted - 2006.04.07 19:34:00 -
[1]
I wrote this to parse my corp mates skills for easy posting on our own forums. Thought it might be of some use to people here. Post any suggestions/problems you find in this thread.
|

knifee
|
Posted - 2006.04.07 23:13:00 -
[2]
any chance u will make the code avalable? i'm not sure ppl (liek me maybe ) will altogether pleased with the idea of letting you see all their skills 
|

Histracko
|
Posted - 2006.04.08 03:27:00 -
[3]
sure, i can make code avaliable, the program doesn't actully save your skills but i can put it up as it isn't anything really sensitive. Here you go:
#!/usr/bin/perl print "Content-Type: text/html\n\n";
open ofile, '> skills.xml' or die; print ofile $data; close(ofile);
open file, $'< skills.xml' or die;
print "<HTML><Head><Title>";
while($line = <file>){ @item = split('<', $line); @item = split('>', $item[1]); if($item[0] =~ /^skillGroup/){ @item = split('\"', $item[0]); if($first == 0){ $toprint = "$item[1]".""."<br>"; $first = 1; }else{ $toprint = "<br>"."$item[1]".""."<br>"; } print $toprint; }elsif($item[0] =~ /^character t/){ @item = split('\"', $item[0]); print $item[5]."'s Skills</Title></Head><Body>\n".$item[5]."'s Skills".""."<br><br>"; }elsif($item[0] =~ /^skillpoints/){ $SP = convert($item[1]); print " - $SP points"; $totalSP = $totalSP + $item[1]; }elsif($item[0] =~ /^skill/){ @item = split('\"', $item[0]); print "$item[1]"; if($item[1]){ $skillCount++; } }elsif($item[0] =~ /^level$/){ print " - level $item[1]"."<br>"; } } $formatedSP = convert($totalSP); print "<br><br>You currently have $skillCount".""." skills and "."$formatedSP".""." skill points";
print "<br><br><br><hr>\n<a href=\"index.htm\">Do Another</a></Body></HTML>";
close(file); $delfile = "skills.xml"; unlink($delfile);
sub convert{ my ($number) = @_; my $size = length($number); my $remain = $size % 3; my @con = ();
if ($remain > 0){ push @con, substr($number, 0, $remain), ','; } while ($remain < $size){ push @con, substr($number, $remain, 3), ','; $remain += 3; } pop @con; $returning = ""; foreach $item(@con){ $returning = $returning . $item; } return $returning; }
|

Histracko
|
Posted - 2006.04.08 03:28:00 -
[4]
Edited by: Histracko on 08/04/2006 03:30:08 the convert function is just a formatting thing and the write to a file is deleted after the script is doe executing. please let me know if this is alt all useful or any chages you make to it as i may want to make it in the main program. FYI this is the exact code used in the script under the link provided in the first post.
|

KaptnSparrow
|
Posted - 2006.04.08 07:24:00 -
[5]
put a method in to download the skill via web automatical,
i should write something like this in java, should take only a hour :) cause my perl skills sucks big, didnt touched it since years :) and make a webservice out of this, yay we are looking for members!
- 0.0 mining - 0.0 ratting - 0.0 hauling
|

CaseyLance
|
Posted - 2006.04.09 07:57:00 -
[6]
Or you can try this one =)
http://oldforums.eveonline.com/?a=topic&threadID=315208
|
| |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |