From dave at unrealize.co.uk Sat Jan 6 02:57:48 2007 From: dave at unrealize.co.uk (David Woodfall) Date: Sat, 6 Jan 2007 09:57:48 +0000 Subject: [elinks-users] Printing Message-ID: <20070106095748.GA23405@TheVoid> Hi, I've been using elinks for a week or so and I'm very impressed with it. But I have been wondering how to print pages. At the moment I'm saving a page and using w3m -dump xxx.htm | lp Is there a way of setting up a keyboard shortcut/alias to do this? -- Men were real men, women were real women, and small, furry creatures from Alpha Centauri were REAL small, furry creatures from Alpha Centauri. Spirits were brave, men boldly split infinitives that no man had split before. Thus was the Empire forged. -- "The Hitchhiker's Guide to the Galaxy", Douglas Adams From kon at iki.fi Sat Jan 6 04:37:31 2007 From: kon at iki.fi (Kalle Olavi Niemitalo) Date: Sat, 06 Jan 2007 13:37:31 +0200 Subject: [elinks-users] Printing In-Reply-To: <20070106095748.GA23405@TheVoid> References: <20070106095748.GA23405@TheVoid> Message-ID: <87mz4wqtc4.fsf@Astalo.kon.iki.fi> A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://linuxfromscratch.org/pipermail/elinks-users/attachments/20070106/2f89b868/attachment.bin From dave at unrealize.co.uk Sat Jan 6 05:16:52 2007 From: dave at unrealize.co.uk (David Woodfall) Date: Sat, 6 Jan 2007 12:16:52 +0000 Subject: [elinks-users] Printing In-Reply-To: <87mz4wqtc4.fsf@Astalo.kon.iki.fi> References: <20070106095748.GA23405@TheVoid> <87mz4wqtc4.fsf@Astalo.kon.iki.fi> Message-ID: <20070106121652.GA9880@TheVoid> On (13:37 06/01/07), Kalle Olavi Niemitalo put forth the proposition: > David Woodfall writes: > > > At the moment I'm saving a page and using > > > > w3m -dump xxx.htm | lp > > > > Is there a way of setting up a keyboard shortcut/alias to do this? > > doc/lua-scripting.txt includes a "Printing" example that formats > the document with ELinks (rather than w3m) and prints the result. > However, it uses "writeto" which apparently is in Lua 4 but not > in Lua 5. For Lua 5, you can instead use: > > -- print the current document (for Lua 5) > function print() > local lp, errmsg = io.popen("lp", "w") > if lp == nil then > error(errmsg) > else > lp:write(current_document_formatted(79)) > lp:close() > end > end > bind_key('main', 'P', print) > > I don't have w3m installed but I imagine you could use "w3m -dump > - | lp" in the popen call and current_document() in lp:write, > or create a temporary file. Thanks for the info. Unfortunately the elinks package I'm using was compiled without Lua support. But I have managed by setting up a URI passing options called Print and pointing to a bash script: elinks -no-references -dump $@ | lp 2>/dev/null 1>&2 Seems to work ok so far. Thanks again. > _______________________________________________ > elinks-users mailing list > elinks-users at linuxfromscratch.org > http://linuxfromscratch.org/mailman/listinfo/elinks-users -- Basic is a high level languish. APL is a high level anguish. From randy at rcs-comp.com Sat Jan 6 23:24:19 2007 From: randy at rcs-comp.com (RCS Computers) Date: Sun, 07 Jan 2007 01:24:19 -0500 Subject: [elinks-users] Fetch Generated Source Message-ID: <45A09213.3080706@rcs-comp.com> I would like to be able to scan an HTML page and get all the links on the page. Obviously, that can be very difficult when the links are generated with JavaScript because you can't just request the document source from the server. Would it be possible to use Elinks to download a web page from a server, run the javascript on the page, and then have it output the resulting HTML? Keep in mind that I would like to do this from the command line so that I can automate this process (if possible). If it is not natively supported, would I be able to script it using PERL and Elinks? Thanks. -- -------------------------------------- Randy Syring RCS Computers & Web Solutions 502-644-4776 http://www.rcs-comp.com "Whether, then, you eat or drink or whatever you do, do all to the glory of God." 1 Cor 10:31 From kon at iki.fi Sun Jan 7 01:14:58 2007 From: kon at iki.fi (Kalle Olavi Niemitalo) Date: Sun, 07 Jan 2007 10:14:58 +0200 Subject: [elinks-users] Fetch Generated Source In-Reply-To: <45A09213.3080706@rcs-comp.com> References: <45A09213.3080706@rcs-comp.com> Message-ID: <87ac0vqmm5.fsf@Astalo.kon.iki.fi> RCS Computers writes: > Would it be possible to use Elinks to download a web page from a server, > run the javascript on the page, and then have it output the resulting > HTML? ELinks does not support document.write, so JavaScript code cannot generate links as HTML. There was an attempt to implement this in 0.12.GIT; the part that captures the written HTML to a string is still there, but the part that parses the HTML from the string was reverted in commit 2c087e52e74528a720621186b91880463e039d50 on 2006-02-12. If you just want to scan the generated links, I think it wouldn't be terribly hard to change ELinks to save the written HTML to a file that a separate program could then parse. This of course does not help if the written HTML tries to run more scripts. The DOM might be another way to make links programmatically, but ELinks does not yet support it either. (I believe 0.12.GIT has some experimental code for setting up a DOM, but none for letting JavaScript access it.) Support for ECMAScript/JavaScript in web pages is an experimental feature and will be disabled by default in ELinks 0.12.0. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://linuxfromscratch.org/pipermail/elinks-users/attachments/20070107/81f17b48/attachment.bin