How to got a preview of a web page

for example i want to have a method which just like

def preview_of ( url )
#some relate operation
end

then i can have a picture (jpeg, png …) of the web page somewhere,
i am not familiar with the graphic libraries of ruby.
do u guys have write something like this ?
thanks :slight_smile:

Also, type properly please. Grammar Nazis Anonymous thanks you for
capitalising words that should be capitalised, and using full words
(“you”).

David V.

Haofei wrote:

def preview_of(url)
opera -newpage #{url}
end

cough

Seriously, this is a nontrivial example that requires you to more or
less write a webbrowser. The simplest (relatively speaking) way would be
to use ruby-gnome2 and Gtk::MozEmbed, and severe whacking of Gtk with a
cluebyfour to make it render to an image buffer which you’d then output
to disk.

David V.

I’m curious - as a newby- where to find existing code snippets that I
can use for chat amongst other things. I saw that there are
repositories but haven’t had much luck. Any recommendations?

Robert

thanks :slight_smile:
to use ruby-gnome2 and Gtk::MozEmbed, and severe whacking of Gtk with a
cluebyfour to make it render to an image buffer which you’d then output
to disk.

David is correct. It’s a problem I’ve spent numerous hours on. All
the existing libraries seem to be lacking. The “easiest” approach is
to use an existing web browser rendering engine.

Michael

where do I start a topic? I only saw where to subscribe and it
looked like it wanted replies going to the [email protected]

Robert McCorkle wrote:

I’m curious - as a newby- where to find existing code snippets that I
can use for chat amongst other things. I saw that there are
repositories but haven’t had much luck. Any recommendations?

Robert

  1. You seem to have written this as a reply to a thread with another
    topic. Try to avoid this, hijacking threads is confusing, and they tend
    get derailed horribly over time by themselves already.

  2. Depends on what kind of chat you want. The path of least effort would
    be running a Jabber or IRC server and using the respective Ruby
    bindings. The path of even less effort would be just using existing
    Jabber servers -and- clients, of course. Depends on your purpose, if you
    want to actually run a chat for some other purpose, or want to reinvent
    the wheel for some reason (doing it better, etc.)

David V.

Robert McCorkle wrote:

where do I start a topic? I only saw where to subscribe and it looked
like it wanted replies going to the [email protected]

Any mailing list post is an email to that address. If it’s a reply to a
post you received, it’s a reply in that thread, if it’s not a reply to
anything, it’s a whole new thread. Email software will group an email
and replies to it together, which makes it easier to follow threads, if
you hijack a thread, people get confused.

David V.

sorry hit the send button before i was done replying…

i want a chat that probly will be reinventing the wheel- though of
course I’d love to grab code similar to lingr or moreso campfire but
I don’t see that type of project in works by anyone else, looks like
they gave up and said use lingr or campfire for their purposes. I’m
a part of 6 other developers that are developing an all encompassed
app to surpass what current bible resources on the web currently
offer- my portion that pulled me into the group was my bible study
online. Currently I use lace but the ajax is too slow and requires
too much server talk and it goes into overflow- whereas all the ruby
implementations i’ve seen are incredible and allow for scalability of
larger groups of people! (more than 7 unlike lace that starts
getting clunky). The chat is very important and i’d like to
integrate it so that its both a group chat and offers IM capabilities
in ruby. Sure it’d be great if i could offer the ability to connect
through existing chat plugins such as jabber/irc/google/etc. But
baby steps- I just need an initial chat to start off with that is
similar to campfire/lingr as that’s my approach that I’m wanting to
take and add customization after that.

Any help is appreciated.

Let go, and let GOD!
Robert

On 11/9/06, James Edward G. II [email protected] wrote:

Page 533 of the Ruby Cookbook has a slim but functional chat server
in about 30 lines of Ruby code.

The code for (most) O’Reilly books is available from the “examples”
link on the book’s catalog page. For this one:

It’s a good book, go buy it! (http://www.oreilly.com/catalog/rubyckbk/)

Keith

cool i’ll try these.

On Nov 5, 2006, at 8:36 AM, Robert McCorkle wrote:

I’m curious - as a newby- where to find existing code snippets that
I can use for chat amongst other things. I saw that there are
repositories but haven’t had much luck. Any recommendations?

Page 533 of the Ruby Cookbook has a slim but functional chat server
in about 30 lines of Ruby code.

James Edward G. II