127

UPDATE: Version 1.1 - MySE section, PrettyPrint, StackPrinter API

Screenshots:

App Homepage Homepage screenshot Printable view Printable view screenshot

Logo:
Logo
https://www.stackprinter.com

StackPrinter is a website that pulls the main details of a given question, all its answers, comments and votes formatting them in a simple essential printable view.

I've created this micro web application basically to add a "Printer-Friendly" feature to the Stack Exchange Network sites, trying to remove some @Media Print CSS limitations like hidden comments, pagination and empty spaces. (rationale here)

Other features:

  • Addons:
    1. Greasemonkey script - Adds a Printer-Friendly button on question's page (FF|Chrome)
    2. Bookmarklet - Allows you to print a question directly from question's page
  • Favorites: lets you browse and print favorites users's questions from:
    1. The Stack Exchange Network
    2. Delicious social bookmarking
  • TopVoted: top voted questions by tags
  • TopPrinted: StackPrinter top printed questions
  • Deleted: popular deleted questions archive
  • MySE: for printing all your Stack Exchange stuff

Demo
Printable question:
What should a developer know before building a public web site? - Stack Overflow
Recovering a lost website with no backup? - Super User
Good tools that fit on a thumb drive - Server Fault
Jon Skeet Facts? - Meta Stack Overflow
API Documentation and Help - Stack Apps

Favorites:
Jon Skeet - Stack Overflow
Jeff Atwood - Stack Overflow
Zoredache - Server Fault
wil - Super User
gangsta75 - Delicious

TopVoted:
python tag - Stack Overflow
discussion tag - Meta Stack Overflow

Deleted:
What's your favorite "programmer" cartoon?

Code
Language: Python
Platform: Google App Engine
Framework: webpy
Source: github
Api: /export
License: BSD

Info

Contact
Contact info

Credits

69
  • 4
    Good job. The questions are formatted nicely! :) Commented May 22, 2010 at 5:18
  • 4
    that is brilliant!!! If only this could be a real part of SO!
    – Matt S.
    Commented May 22, 2010 at 13:34
  • 1
    oh man! also, why don't you modify it so it displays the actual value of the link. Displaying just the text doesn't mean a lot unless you can view the URL as well
    – Matt S.
    Commented May 22, 2010 at 22:07
  • 3
    the url. Just blue text tells me nothing. I want to see the actual URL so I can type it in later :)
    – Matt S.
    Commented May 23, 2010 at 2:08
  • 4
    How about doing what Wikipedia does, and have all the links at the bottom of the page? Then just use [1], [2], etc. in the posts. Commented May 23, 2010 at 7:17
  • 1
    @George do you think it would be useful? Commented May 23, 2010 at 11:40
  • 2
    What if I am going to make more than 10K prints per hour?
    – user451
    Commented May 23, 2010 at 15:52
  • 5
    @Koning Amazon Forest will disappear in no time. Commented May 23, 2010 at 16:02
  • 1
    @sys: I think so - if there were a lot of links, the pages would be much easier to read. Commented May 23, 2010 at 16:04
  • 1
    No I mean the API request limit
    – user451
    Commented May 24, 2010 at 7:57
  • 2
    TREE KILLER!!!! 8-p Commented Jul 5, 2010 at 0:26
  • 2
    Great application -- there are still a few cases where a nice printout beats reading something on the screen. Suggestion: include the original question URL in prominent fashion near the top of the printout. That would be a good reference from the printed page back to the online version.
    – BrianC
    Commented Jul 5, 2010 at 19:32
  • 2
    @kenorb just add &printer=true at the end of the url if you don't want ads. Commented May 13, 2015 at 14:14
  • 2
    to be https compliant, it's time to update the bookmarklet regex to ^https?://(.*?)\.com/questions/([0-9]+)/
    – Kul-Tigin
    Commented Jun 19, 2017 at 20:50
  • 2
    I have been using Brett Terpstra's "Answered" (brettterpstra.com/projects/answered) bookmarklet. It offers some of the same functionality, but StackPrinter offers more options for archival purposes. Commented Aug 31, 2017 at 15:16

4 Answers 4

20

Addons

Stackprinter allows you to print directly from Stack Exchange sites using Greasemonkey script or an handy bookmarklet.
Greasemonkey script adds a Printer-Friendly button to the question you are browsing (Firefox and Chrome both supported).
Bookmarklet is useful if Greasemonkey is not an option and has the same effect of Printer-Friendly button, allowing the print of the question straight from the question page.

alt text

Favorites

Favorites allows you to browse and print your favorite questions or other users favorites.
Stackprinter supports all Stack Exchange sites plus Delicious social bookmarking service.
Just star or save your questions and browse Stackprinter to print all of them later.

Users search
alt text

Favorites result
alt text

[Q]uicklook alt text

Delicious result
link text

TopVoted

TopVoted allows you to browse and print the best questions searched by tags.

Tags search
link text

TopVoted result
link text

1
  • 1
    Is there no way to 'print all' questions or answer by a particular user?
    – Iceberry
    Commented Feb 28, 2019 at 6:26
5

I asked this as a question, but apparently the convention is to report bugs/feature requests in the announcement thread. It appears, that the MathJax extension mhchem is currently not enabled in the StackPrinter app. This is rather inconvenient for most of the chemistry.se questions and answers. It would therefore be nice if this feature could be enabled for the StackPrinter app.

Example:
Please consider the sandbox on meta.chemistry.se and its printed version (also see the screenshot below). You can see in the first equation of my post the red \ce. I enabled the mhchem package manually via \require{mhchem] after that and the same command renders now.

printed result

5
  • I will take a look at it, is this extension available on Cdn? Commented Apr 21, 2015 at 12:43
  • I do not know what Cdn is. The extension is part of the whole MathJax package. It is probably just a variable that has to be toggled, since it is already available, as the screenshot proves. Thanks for having a look. Commented Apr 21, 2015 at 12:55
  • Oh OK, it should be easy to fix.(maybe tonight) Commented Apr 21, 2015 at 14:39
  • Should be fixed, give it a try. Commented Apr 21, 2015 at 21:15
  • @systempuntoout It works like a charm, thank you very much. Great app! Commented Apr 22, 2015 at 3:10
5

Here is a small script (stackprinter) which uses Stack Printer from the command-line:

#!/bin/sh
type wkhtmltopdf || { echo >&2 "wkhtmltopdf command is required. Aborting."; exit 1; }
: ${1?"Usage: $0 (url)"}
URL=$1 && shift
HOST=$(echo "$URL" | grep -Eo "([.[:alnum:]]*?)\.(com|net|org)" | head -c-5)
QID=$(echo "$URL" | grep -o "[0-9].*/" | head -c-2)
PRINTURL="http://www.stackprinter.com/export?format=HTML&printer=true&service=$HOST&question=$QID"
FILENAME=$(curl -s "$URL" | grep -o "<title>[^<]*" | tail -c+8)
wkhtmltopdf $* "$PRINTURL" "$FILENAME.pdf" && echo "'$FILENAME.pdf' saved."

Usage:

./stackprinter (url)

Example (tested on OS X):

$ ./stackprinter http://stackapps.com/questions/179/stackprinter-the-stack-exchange-printer-suite
'app - StackPrinter: The Stack Exchange Printer Suite - Stack Apps.pdf' saved.
1
  • head -c-2 doesn't work on macOS, is the intent to get the first string of alphanumerics out of the URL? I guess sed 's/[^0-9]*//;s/[^0-9].*//' would do that in a single process. Of course, using parameter expansion would do it without any external process at all (but require several steps and maybe a temporary variable).
    – tripleee
    Commented Jun 10, 2021 at 4:25
4

The default bookmarklet javascript has problems when used with mathoverflow. Because annoyingly mathoverflow ends with a .net instead of a .com. I made some changes so that it could also work with mathoverflow (feel free to improve on it):

javascript:(
function(){
  var re = new RegExp('^https://(.*?)\.com/questions/([0-9]+)/');
  var group = re.exec(window.location.href);
  if (group==null)
  {
    re = new RegExp('^https://(.*?)\.net/questions/([0-9]+)/');
    group = re.exec(window.location.href);
  }
  if (group!=null)
  {
    var service = group[1];
    var questionid=group[2];
    window.open('http://www.stackprinter.com/export?format=HTML&service='+service+'&question='+questionid);
  }
  else
    alert('Attention: question id not found!');
}
)()
2
  • Thanks for your contribution! Perhaps you could replace \.com with \.(com|net)?
    – Glorfindel
    Commented Aug 11, 2021 at 13:48
  • I know what you mean. I did not know how to make this work with RegExp but I don't think your suggestion works. I think it's a bit more complicated than that. Anyway, I tried it and it didn't work for me.
    – Jose Capco
    Commented Aug 12, 2021 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .