Link To Masses Of External Data In Openoffice?

This is what I want to do.

I’m looking for a way to link massive amounts of data in OpenOffice for
a sim league I’m in. Here’s an example of what I’m trying to link to my
spreadsheet.
http://rslsim.atspace.com/html/players/player1stats.htm
You see player1stat. There are roughly 600 players though, and linking
everyone separately would be way to tedious. The only thing that changes
in the link is the player number for example:
http://rslsim.atspace.com/html/players/player1stats.htm
http://rslsim.atspace.com/html/players/player2stats.htm

http://rslsim.atspace.com/html/players/player600stats.htm
etc etc

I want to import all of them into a spreadsheet. What’s the most
efficient way to do this? Another program? Another way? Please help.

So someone helped me out and made a code for Ruby.
This is the code.

$ ruby -rmechanize -e’n=(1…600); a=Mechanize.new; n.each{|j|
o=a.get(“http://rslsim.atspace.com/html/players/player#{j}stats.htm”);
b=o.search(“tr”); [1,2,4].each{|q| puts b[q].search(“td”).map{|i|
i.text}.join(“,”) } } ’ > data.csv

I installed Gem Mechanizer too but he uses Linux and when I put this
code in (I use Windows) I get this error : ‘j’ is not recognized as an
internal or external command, operable program or batch file.

Can someone convert this into a windows code possibly or tell me what
I’m doing wrong? I know it can be done because he did it on Linux but
doesn’t know how to do it on Windows.

On Jul 23, 2013, at 5:29 PM, Austin J. [email protected] wrote:

doesn’t know how to do it on Windows.
Your problem isn’t with the ruby code, it’s with the difference between
a linux shell and windows cmd.exe.

Take the code between the first ’ and the last ’ and put it in a file
called, say, ‘scrape.rb’. Then change the command to:

C:> ruby -rmechanize scrape.rb > data.csv

tamouse m. wrote in post #1116598:

On Jul 23, 2013, at 5:29 PM, Austin J. [email protected] wrote:

doesn’t know how to do it on Windows.
Your problem isn’t with the ruby code, it’s with the difference between
a linux shell and windows cmd.exe.

Take the code between the first ’ and the last ’ and put it in a file
called, say, ‘scrape.rb’. Then change the command to:

C:> ruby -rmechanize scrape.rb > data.csv

Like put it in a notepad and name it that?

On Jul 24, 2013, at 9:13 PM, Austin J. [email protected] wrote:

Like put it in a notepad and name it that?

Just like that. :slight_smile:

tamouse m. wrote in post #1116750:

On Jul 24, 2013, at 9:13 PM, Austin J. [email protected] wrote:

Like put it in a notepad and name it that?

Just like that. :slight_smile:

I tried and it still didn’t work. :frowning:

tamouse m. wrote in post #1116838:

On Jul 26, 2013, at 2:03 PM, Austin J. [email protected] wrote:

tamouse m. wrote in post #1116750:

On Jul 24, 2013, at 9:13 PM, Austin J. [email protected] wrote:

Like put it in a notepad and name it that?

Just like that. :slight_smile:

I tried and it still didn’t work. :frowning:

and what happened?

C is not recongnized as an internal or external command

On Jul 26, 2013, at 2:03 PM, Austin J. [email protected] wrote:

tamouse m. wrote in post #1116750:

On Jul 24, 2013, at 9:13 PM, Austin J. [email protected] wrote:

Like put it in a notepad and name it that?

Just like that. :slight_smile:

I tried and it still didn’t work. :frowning:

and what happened?

On Sat, Jul 27, 2013 at 5:55 AM, Austin J. [email protected] wrote:

tamouse m. wrote in post #1116838:

On Jul 26, 2013, at 2:03 PM, Austin J. [email protected] wrote:
C:> ruby -rmechanize scrape.rb > data.csv

C is not recongnized as an internal or external command

You don’t have to type C:>, that is meant to represent your prompt.
Just type the part that starts with ruby:

ruby -rmechanize scrape.rb > data.csv

Jesus.

“Jesús Gabriel y Galán” [email protected] wrote in post
#1116883:

On Sat, Jul 27, 2013 at 5:55 AM, Austin J. [email protected] wrote:

tamouse m. wrote in post #1116838:

On Jul 26, 2013, at 2:03 PM, Austin J. [email protected] wrote:
C:> ruby -rmechanize scrape.rb > data.csv

C is not recongnized as an internal or external command

You don’t have to type C:>, that is meant to represent your prompt.
Just type the part that starts with ruby:

ruby -rmechanize scrape.rb > data.csv

Jesus.

Sorry, I don’t really know anything about this, it’s the only way to do
what I want to do though.

It’s saying theres no such file or directory – scrape.rb (Load Error)

What did I do wrong now?

unknown wrote in post #1116906:

Am 27.07.2013 21:04, schrieb Austin J.:

Just type the part that starts with ruby:
What did I do wrong now?
The file must located in the same directory/folder where you start your
ruby executable.

You can make sure with the dir' command:scrape.rb’ should be listed
among the shown files.

Regards,
Marcus

Yeah it’s not in there, I have the scrape.rb in the Ruby folder so
idk… is it actually supposed to be named scrape.rb, is rb an
extension? I feel like an idiot asking this lol

Am 27.07.2013 21:04, schrieb Austin J.:

Just type the part that starts with ruby:
What did I do wrong now?
The file must located in the same directory/folder where you start your
ruby executable.

You can make sure with the dir' command:scrape.rb’ should be listed
among the shown files.

Regards,
Marcus

Am 27.07.2013 22:12, schrieb Austin J.:

Regards,
Marcus

Yeah it’s not in there, I have the scrape.rb in the Ruby folder

So… change to the correct directory… (using `cd’).

And you should search for an introduction to the DOS prompt or
command prompt (cmd.exe).

is it actually supposed to be named scrape.rb, is rb an
extension? I feel like an idiot asking this lol

Yes. `rb’ is the commonly used file extension.

You might want to check out Learn to Program, by Chris Pine,
a nice introduction to some (Ruby) programming fundamentals.

Regards,
Marcus

unknown wrote in post #1116910:

Am 27.07.2013 22:12, schrieb Austin J.:

Regards,
Marcus

Yeah it’s not in there, I have the scrape.rb in the Ruby folder

So… change to the correct directory… (using `cd’).

And you should search for an introduction to the DOS prompt or
command prompt (cmd.exe).

is it actually supposed to be named scrape.rb, is rb an
extension? I feel like an idiot asking this lol

Yes. `rb’ is the commonly used file extension.

You might want to check out Learn to Program, by Chris Pine,
a nice introduction to some (Ruby) programming fundamentals.

Regards,
Marcus

Yeah, I am just trying to do this one thing though :frowning:

How do I make it an .rb file extention, it always saves as a .txt in
notepad.

I’m getting somewhere. It’s creating the data file but there’s nothing
inside it now.

It says:

C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
‘require’ cannot load such file – mechanize (LoadError)
from
C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
‘require’

Any ideas?

Am 28.07.2013 00:30, schrieb Austin J.:

I’m getting somewhere. It’s creating the data file but there’s nothing
inside it now.

It says:

C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
‘require’ cannot load such file – mechanize (LoadError)
from
C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
‘require’

`mechanize’ is a so-called gem, which you need to install first.

In the command prompt, type

gem install mechanize

Regards,
Marcus

unknown wrote in post #1116930:

Am 28.07.2013 00:30, schrieb Austin J.:

I’m getting somewhere. It’s creating the data file but there’s nothing
inside it now.

It says:

C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
‘require’ cannot load such file – mechanize (LoadError)
from
C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
‘require’

`mechanize’ is a so-called gem, which you need to install first.

In the command prompt, type

gem install mechanize

Regards,
Marcus

Got this error now.

ERROR: While executing gem … (Gem::DependencyError)
Unable to resolve dependencies: mechanize requires net-http-digest_auth
()=1.1.1, ~> 1.1>

Installed DevKit because it told me to. And now when I try to install
mechanize I get a bunch of errors.

libxml2 is missing

It logged my results, this is the log

C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for libxml/parser.h… no

libxml2 is missing. please visit
Installing Nokogiri - Nokogiri for help with
installing dependencies.

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details.
You may
need configuration options.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=C:/Ruby200-x64/bin/ruby
–with-zlib-dir
–without-zlib-dir
–with-zlib-include
–without-zlib-include=${zlib-dir}/include
–with-zlib-lib
–without-zlib-lib=${zlib-dir}/lib
–with-iconv-dir
–without-iconv-dir
–with-iconv-include
–without-iconv-include=${iconv-dir}/include
–with-iconv-lib
–without-iconv-lib=${iconv-dir}/lib
–with-xml2-dir
–without-xml2-dir
–with-xml2-include
–without-xml2-include=${xml2-dir}/include
–with-xml2-lib
–without-xml2-lib=${xml2-dir}/lib
–with-xslt-dir
–without-xslt-dir
–with-xslt-include
–without-xslt-include=${xslt-dir}/include
–with-xslt-lib
–without-xslt-lib=${xslt-dir}/lib
–with-libxslt-config
–without-libxslt-config
–with-pkg-config
–without-pkg-config
–with-libxml-2.0-config
–without-libxml-2.0-config
–with-pkg-config
–without-pkg-config
–with-libiconv-config
–without-libiconv-config
–with-pkg-config
–without-pkg-config

Eric C. wrote in post #1117074:

On Sat, Jul 27, 2013 at 5:17 PM, Austin J. [email protected] wrote:

command prompt (cmd.exe).
Marcus

Yeah, I am just trying to do this one thing though :frowning:

How do I make it an .rb file extention, it always saves as a .txt in
notepad.

Put double quotes around the name in the Save As dialog.

Thanks, now I just need that other part answered :stuck_out_tongue:

On Sat, Jul 27, 2013 at 5:17 PM, Austin J. [email protected] wrote:

command prompt (cmd.exe).
Marcus

Yeah, I am just trying to do this one thing though :frowning:

How do I make it an .rb file extention, it always saves as a .txt in
notepad.

Put double quotes around the name in the Save As dialog.