LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 10-18-2022, 04:10 PM   #1
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Download a thread


Is it possible to download a thread as text?
 
Old 10-18-2022, 04:28 PM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,078

Rep: Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170

Thread can mean different things. I'm guessing you are you asking about LQ forum threads, but you really should clarify.

Since a forum thread is rendered as HTML, which is text, and you can either view source or use Curl to download that HTML, then the answer is technically yes.

But if you're asking does the forum software contain a render to non-HTML text feature, given the absence of such an option in Thread Tools, the answer is no.

However, there is a simplified "Printable Version" which one could run through a HTML to Markdown converter - though it would need special handling to deal with quoted sections appropriately, since they don't use semantic markup, and whether that's worth the effort depends on what you're after. It may be simpler to just copy-paste.

 
1 members found this post helpful.
Old 10-19-2022, 12:30 AM   #3
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Yes I was thinking about a thread here at LQ, I should have clarified.

Basically what I meant as text, is just text, no HTML which is unnecessary and not very useful as a note or insert in a text file. I guess copy and paste could do that then.
 
Old 10-19-2022, 01:21 AM   #4
artytux
Member
 
Registered: Oct 2022
Location: Central Eastcoast Australia
Distribution: SpiralLinux
Posts: 48

Rep: Reputation: 19
Hello
I wonder if the idea of save as pdf would be of use IF you are using Firefox their addons are OK
There is two I use, one of is really good ((Save as PDF by Pdfcrowd)blue icon),
the other bit flaky at times but very light ((Save PDF Save current page as PDF)red icon) and bonus works offline also

Quote:
Basically what I meant as text, is just text, no HTML which is unnecessary and not very useful as a note or insert in a text file. I guess copy and paste could do that then.
Regards
artytux
 
Old 10-19-2022, 02:17 AM   #5
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Look at the very top immediately above whatever #<number, like 1,16,31,...> of any post's page, and you will see 3 pulldowns: 'Thread Tools' (& Search this Thread & Rate Thread, which makes the concept of a thread infinitely obvious). The first pull down under 'Thread Tools' is: 'Show Printable Version'. Once you have selected this, you will get all the posts on one simple (html) text page, ready for you to hit ctrl+p or whatever (usually you can: 'print to a file', depending on your OS).

Last edited by !!!; 10-19-2022 at 02:26 AM.
 
4 members found this post helpful.
Old 10-19-2022, 05:44 AM   #6
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Thank you all, I see that the answer was on post 2, but it was kind of complicated.
 
Old 10-19-2022, 06:26 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,853
Blog Entries: 41

Rep: Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035Reputation: 3035
Moderator Response

Moved: This thread is more suitable in <LQ Suggestions & Feedback > and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 10-19-2022, 07:37 AM   #8
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,078

Rep: Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170
Quote:
Originally Posted by artytux View Post
I wonder if the idea of save as pdf would be of use IF you are using Firefox their addons are OK
There is no need to use addons for this - Firefox can produce a PDF of the current page using File > Print > Print To File.

 
1 members found this post helpful.
Old 10-19-2022, 07:44 AM   #9
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,078

Rep: Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170Reputation: 2170
Quote:
Originally Posted by Debian6to11 View Post
Basically what I meant as text, is just text, no HTML which is unnecessary and not very useful as a note or insert in a text file. I guess copy and paste could do that then.
The downside to copy and paste is you lose the nesting/demarcation of quotes - for longer threads/posts with lots of interleaved quotes that becomes a bigger issue.

However, I was curious so I grabbed a suitable Python module and, well the result isn't great, but is better than I expected, and might be acceptable.

1. Download html2text (either file works) and extract just the "html2text" directory to current directory.
1b. Briefly review the code to make sure it's not doing anything weird. (General good practice when downloading from unreviewed public repos like pypi.)

2. Right click and "Save Link As" on "Show Printable View" to get the simplified HTML file.

3. The module can be run from command line with, e.g: "python3 -m html2text ./input.html > ./output.txt"

4. Load output.txt in your text viewer of choice (or pipe the output to "less" if one just wants a quick preview).

That was just the first module I found, there may well be others that do a better job, or it may itself work better by using some of the various options it has (see "python3 -m html2text --help")


Last edited by boughtonp; 10-19-2022 at 09:37 AM.
 
Old 10-19-2022, 03:53 PM   #10
teckk
Senior Member
 
Registered: Oct 2004
Distribution: Arch
Posts: 4,513
Blog Entries: 5

Rep: Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571Reputation: 1571
Quote:
Is it possible to download a thread as text?
Code:
url="https://www.linuxquestions.org/questions/lq-suggestions-and-feedback-7/download-a-thread-4175717890/"

lynx -dump "$url" > out.txt
 
1 members found this post helpful.
Old 10-20-2022, 03:40 AM   #11
artytux
Member
 
Registered: Oct 2022
Location: Central Eastcoast Australia
Distribution: SpiralLinux
Posts: 48

Rep: Reputation: 19
Quote:
Originally Posted by boughtonp View Post
There is no need to use addons for this - Firefox can produce a PDF of the current page using File > Print > Print To File.

OK Strange this I never knew that was there, awesome, works and so easy, never looked why would I click that when I have no printer,
Thanks heaps boughtonp
regards
artytux
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for good or best "multi-thread" or "multiple download" download manger. brjoon1021 Linux - Software 1 09-25-2008 04:26 PM
can a reader thread and a writer thread r/w to same fd mxandres Programming 1 07-18-2004 11:56 PM
configure qt thread issue (just compiled qt w/ -thread option) cleff Linux - Software 8 05-08-2004 12:11 AM
send parameter from thread to thread marek Programming 2 09-08-2003 06:33 AM
Can a thread starter close the thread? ppuru LQ Suggestions & Feedback 3 07-26-2003 07:51 PM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 10:43 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