webclipper / web-clipper

For Notion,OneNote,Bear,Yuque,Joplin。Clip anything to anywhere
https://clipper.website
Other
6.16k stars 559 forks source link

Improved support for StackOverflow, StackExchange, AskUbuntu, … #533

Open alexanderadam opened 4 years ago

alexanderadam commented 4 years ago

I know that this feature request is very specific but when I try to clip a complete StackOverflow page the output is not very well arranged but I guess this could be very useful for many people if the outcome of a full StackOverflow clip could be improved.

PS: Thank you so much for web-clipper! :heart:

DiamondYuan commented 4 years ago

sounds good. But i'm not sure how to use markdown to show StackOverflow,StackExchange.

# Question
balata

## Answer 
### by xx
answer1

Do you have any ideas?

alexanderadam commented 4 years ago

First of all, thank you so much for your response and your work in general.

I just converted an example by hand, to see how it could look like (I cannot attach markdown files in github, therefore you can see this example inline).

(Click to expand) ```markdown # [Opening a .msg file in Ubuntu](https://superuser.com/questions/99250/opening-a-msg-file-in-ubuntu) _[Saved from superuser.com at 31.08.2020](https://superuser.com/questions/99250/opening-a-msg-file-in-ubuntu)_ Someone send me a .msg file skype, and somehow I just can't open this in Ubuntu Is there a app in which I can open this file? asked Jan 22 '10 at 13:00 by [Elitmiar](https://superuser.com/users/7071/elitmiar) - This could be many things...what type is this file? There are several different programs using the msg extension. – [Bobby](https://superuser.com/users/12567/bobby "8,614 reputation") [Jan 22 '10 at 13:11](#comment100762_99250) - @Roland can you check my answer and mark it as tick if it works perfectly and solves your issue – [Akhil Surapuram](https://superuser.com/users/880537/akhil-surapuram "209 reputation") [Aug 19 '19 at 8:13](#comment2220519_99250) ## 9 Answers --- ## Answer 1 from Aug 19 '19 at 8:11 by [Akhil Surapuram](https://superuser.com/users/880537/akhil-surapuram) Hie, Even though there are a lot of Answers available but not of them are simple and easy to use so I am posting this Answer. > **Use Microsoft one drive to open .msg files online via browser** Sign in to your Microsoft onedrive account and upload the .msg file. After upload, you can click on it to view the file contents. and advantage over other answers is you won't be sharing your file with third party file converters. Note: This method is Non-OS specific and can be applied in any OS. - I wish I could edit the message also. – [Jaakko](https://superuser.com/users/448942/jaakko "250 reputation") [Oct 2 '19 at 12:44](#comment2245622_1472788) - @Jaakko .msg files are email conversation thread. I coundn't find any sense of editing it. I think you can copy text content for forwarding mail purposes – [Akhil Surapuram](https://superuser.com/users/880537/akhil-surapuram "209 reputation") [Oct 2 '19 at 16:38](#comment2245745_1472788) - despite that fact this is not a *solution* for the problem, in some particular cases your suggestion works very good! – [radistao](https://superuser.com/users/219411/radistao "143 reputation") [Feb 14 at 12:39](#comment2311873_1472788) - @radistao thanks for the compliment. I say you don't have to convert the file to open .msg you just need to use Microsoft tools. for ubuntu, it's only in web and an electron version i.e nothing but the web. & yeah it definietly solves the problem of viewing .msg and therefore it can be treated as solution :P – [Akhil Surapuram](https://superuser.com/users/880537/akhil-surapuram "209 reputation") [Feb 15 at 6:05](#comment2312313_1472788) - After opening a .msg file on the OneDrive (using current Google Chrome) I can read the message body but I don't see a way to open attachments contained in the message and listed on the Attachments line. – [rpr](https://superuser.com/users/136227/rpr "430 reputation") [May 28 at 11:32](#comment2367296_1472788) --- ## Answer 2 from Feb 13 at 14:19 by [cfstras](https://superuser.com/users/118213/cfstras) If you're on Windows, Mac, or another Linux than Ubuntu, or you don't want to install random packages on your system, I'd recommend building on [Georg Jung's answer](https://superuser.com/a/979603/118213) by using [this docker container](https://github.com/tulequ/docker-msgconvert): ``` docker run -it --rm -v $(pwd):/mails --user $UID: lequoctuan/msgconvert my-file.msg # takes a minute ... cat my-file.eml ``` --- ## Answer 3 from Oct 8 '13 at 14:49 by [bragboy](https://superuser.com/users/29725/bragboy) Try this link: [https://www.coolutils.com/online/Mail-Converter/](https://www.coolutils.com/online/Mail-Converter/) I came to this post searching for an answer, found the above link which did the job for me. Hence wanted to share here. If you are concerned about privacy, you can buy their desktop version and convert it. - Just curious, why all the downvotes? Seems like a perfectly good tool. – [Duncan X Simpson](https://superuser.com/users/341338/duncan-x-simpson "1,282 reputation") [May 9 '16 at 3:10](#comment1516244_656028) - @VirtualDXS - Life is harsh, isn't it ? :) – [bragboy](https://superuser.com/users/29725/bragboy "319 reputation") [May 10 '16 at 20:28](#comment1517692_656028) - I also downvote this "solution", because it violates privacy. .msg files sometimes contain mail threads, which must be kept confidential. – [slowhand](https://superuser.com/users/598716/slowhand "101 reputation") [May 27 '16 at 15:29](#comment1529535_656028) - I don't get where the tool violates privacy. It's just a wrong statement. It's the same saying Winrar violates privacy because sometimes .rar files contain files which may be confidential. Or an SQLite client violates privacy because you can read Skype conversations from .db file. – [Andre Figueiredo](https://superuser.com/users/191231/andre-figueiredo "203 reputation") [Oct 4 '17 at 18:45](#comment1846334_656028) - @AndreFigueiredo: It’s the difference between an online tool and a local program.  When you process data with WinRAR or any other program on your computer, the data stay on your computer (unless it’s infected with spyware). But with this “coolutils” solution, you upload your file to their website and then download the result.  Do they immediately delete your data off their servers?  Are their personnel allowed to look at your data?  Do they sell your data to other people? Once you give it to them, it’s out of your control. – [Scott](https://superuser.com/users/150988/scott "18,141 reputation") [Nov 9 '17 at 23:51](#comment1866560_656028) --- ## Answer 4 from Dec 6 '19 at 22:54 by [pooryorick](https://superuser.com/users/161618/pooryorick) Another free and cross-platform tool for extracting the contents of an Outlook msg file from the command line is [msg-extractor](https://github.com/mattgwwalker/msg-extractor). --- ## Answer 5 from Nov 9 '17 at 14:49 by [Stéphane](https://superuser.com/users/611770/st%c3%a9phane) You can also proceed like this: ``` strings foo.msg |html2text ``` --- ## Answer 6 from Jul 6 '17 at 12:29 by [RousseauAlexandre](https://superuser.com/users/613231/rousseaualexandre) It's not perfect but you can import `.msg` file with [Mozilla Thunderbird](https://www.mozilla.org/en-US/thunderbird/) *(it works with on 52.1.1 on my Linux Mint)*. **I had some encoding error but you can globally read the content.** In Thunderbird you click on *File* \> *Open* \> *Saved message* and select your `.msg` file. - For my case, with this method, the file is totally unreadable. – [Pierre-Olivier Vares](https://superuser.com/users/354723/pierre-olivier-vares "111 reputation") [Mar 11 '19 at 13:14](#comment2132454_1226286) - This kind of works. I can see a plain text message at the top with a lot of issues under it but I think it has got the text content of the email right. – [Qwertie](https://superuser.com/users/280896/qwertie "723 reputation") [Apr 1 '19 at 0:10](#comment2143231_1226286) - There is no encoding error it simply than the encoding of the Outlook file (*.msg) is ANSI. I have the following in my .bash_profile : function msgread() { msgconvert --outfile - "$1" | iconv -f ms-ansi -t utf-8 | less } – [Stéphane](https://superuser.com/users/611770/st%c3%a9phane "149 reputation") [Jan 24 at 15:12](#comment2301524_1226286) --- ## Answer 7 from May 6 '16 at 16:36 by [Juan](https://superuser.com/users/203231/juan) I ran across such a file as well (provided to me by a colleague who saved an email message in Microsoft Outlook). `file(1)` identifies the .msg file like so: ``` foo.msg: Composite Document File V2 Document ``` Georg Jung's answer regarding Matijs van Zuijlen's perl-based `msgconvert(1)` utility steered me in the right direction. Although my system does not at the time of this writing have the msgconvert utility packaged, the install instructions on Matijs' web page indicate using `cpan` as one way to install it: ``` cpan -i Email::Outlook::Message ``` The cpan URL is [http://search.cpan.org/dist/Email-Outlook-Message/](http://search.cpan.org/dist/Email-Outlook-Message/) --- ## Answer 8 from Sep 29 '15 at 9:57 by [Georg Jung](https://superuser.com/users/301221/georg-jung) This is an MS-Outlook format. There is a command line tool called MSGConvert (see [www.matijs.net/software/msgconv](http://www.matijs.net/software/msgconv/)) which converts .msg files into .eml. You can open those with Thunderbird or Evolution. On Ubuntu you should be able to install the tool using ``` sudo apt-get install libemail-outlook-message-perl libemail-sender-perl ``` from a command line. Use ``` msgconvert *.msg ``` to convert every file in a directory at once. MSGConvert will produce copies of your .msg-files with the suffix .msg.eml. Regardless, your friend should learn how to send content properly. - Somehow msgconvert didn't appear in the path, but the following worked: `perl -we 'use Email::Outlook::Message; print Email::Outlook::Message->new(shift)->to_email_mime->as_string' foo.msg >bar.eml` – [Dallaylaen](https://superuser.com/users/163922/dallaylaen "101 reputation") [Jan 28 '16 at 17:54](#comment1440311_979603) - Just to note, on debian based systems the msgconvert script isn't in the package. You can get it from the repo however here: [github.com/mvz/email-outlook-message-perl](https://github.com/mvz/email-outlook-message-perl) – [PottyBert](https://superuser.com/users/551376/pottybert "101 reputation") [Mar 3 '16 at 13:58](#comment1467915_979603) - Using the msgconvert tool from [github.com/mvz/email-outlook-message-perl](https://github.com/mvz/email-outlook-message-perl), the command line `./msgconvert file.msg` produces nothing. You have to use `./msgconvert --outfile file.eml file.msg`. – [slowhand](https://superuser.com/users/598716/slowhand "101 reputation") [May 27 '16 at 15:53](#comment1529556_979603) - If you already did `apt-get install libemail-outlook-message-perl`, you don't need to do anything more. That package already contains `/usr/bin/msgconvert`, at least on Debian 8 Jessie. – [Axel Beckert](https://superuser.com/users/389434/axel-beckert "524 reputation") [Jan 4 '17 at 14:18](#comment1677044_979603) --- ## Answer 9 from Jan 22 '10 at 13:45 by [quack quixote](https://superuser.com/users/12786/quack-quixote) Try running this command in a terminal to identify the type of file: ``` $ file foo.msg ``` The output should tell you what type of file it is. If it's a text file of some kind, you can open it in *gedit* or your favorite text editor. - obviously, replace "foo.msg" with the name of your *.msg* file. – [quack quixote](https://superuser.com/users/12786/quack-quixote "38,288 reputation") [Jan 22 '10 at 13:46](#comment100781_99267) - It gives `Composite Document File V2 Document, No summary info` and is an Outlook file for emails. See also [How do I view an Outlook .msg file?](http://askubuntu.com/q/24884/10425) – [Martin Thoma](https://superuser.com/users/64857/martin-thoma "2,855 reputation") [Jun 5 '13 at 4:46](#comment745328_99267) - I think this should be a comment – [Greg Schmit](https://superuser.com/users/677364/greg-schmit "192 reputation") [Oct 5 '18 at 13:18](#comment2050808_99267) ```

This could be a compromise between storing all relevant information and keeping a logical order.

Depending on the renderer, the result could look like this (of course it's just an excerpt):

Screenshot from 2020-08-31 21-05-04