LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2012, 03:17 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,508

Rep: Reputation: 234Reputation: 234Reputation: 234
Bash to convert HTML to EPUB/MOBI?


Hi

Let's take an example.

You take daily the train and would like your linux box grab the news over html and rss, and make an epub.

You box has bash, elinks, wget, curl, and imagemagick.

Would you know if it might be possible?

wget http://edition.cnn.com/WORLD/ -O page.html

and then... making/creating an epubof thsi page.html

thanks
 
Old 11-24-2012, 03:50 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi,

Quote:
Originally Posted by Xeratul
You box has bash, elinks, wget, curl, and imagemagick
I don't know, but there are addons for Firefox and Google-chrome which convert html-pages to epub-format.
On wikipedia there's a list of programs.

Markus
 
Old 11-25-2012, 12:05 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Do you mean doing everything using only basic shell tools? I imagine it would be quite tricky to do in such a case. You'd have to write functions to manually analyze the html for conversion to the desired format. And html is not a format that can be reliably processed with the line-and-regex based tools available in a basic shell.

It should be quite possible however to write a script that would download the html and then run it through a dedicated converter, such as pandoc.


Finally, calibre apparently has the ability to download and convert web pages into ebook formats. But unless its one of the preinstalled ones you'd probably have to write your own filter plugin for it.

Last edited by David the H.; 11-25-2012 at 12:06 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to export pdf files to mobi or epub without weird artifacts/characters linux_BSD Linux - Software 7 10-20-2012 07:01 PM
LXer: How to Convert RSS Feeds into EPUB files with Calibre LXer Syndicated Linux News 0 06-15-2012 08:50 PM
Bash: Can we convert/print2pdf a html page to PDF format ? frenchn00b Linux - General 3 03-02-2008 09:02 AM
how to convert text(html) back to html. d1l2w3 Linux - Software 4 04-08-2005 09:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration