blog 
Making a Blook with Wordpress and Pages
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
For a few months now, I’ve wanted to create a blook (blog + book) from the posts I’ve written in 2006 (something like the Lifehacker book). I’ve been waiting for Blurb to get around to it, but their application can only import wordpress blogs that are hosted on wordpress.com. Since my blog is hosted remotely, that’s a no go. I exchanged a couple emails with somebody at their company who informed me that sometime in 2007 their program would have the ability to import all wordpress blogs, regardless of the hosting situation.
I’m not a patient person.
And so, when I was reminded about my blook desire after reading Ben’s post, I decided to put off the ~10 other things I was supposed to do today (except for attending the temple, of course) and write my own script to do just this.
Here’s what the script does:
- At the top you enter the necessary data to connect to your wordpress database as well as a starting and ending date for running the query.
- The script will then extract all posts and comments between the given date range.
- All links are removed from the posts and comments, leaving just the words that were linked along with a footnote mark. After the post/comment, a list of the links (with their corresponding footnote numbers) is printed.
- All embedded youtube and google videos are removed. The script replaces the video with the text {VIDEO: http://urlOfVideo}.
- CSS classes are assigned to the post title, date text, links and comment titles, and link list. This allows you to change all global styles in Pages (or a similar app), so that if you want to change all your post titles to red, you can change it once and be done.
Once you’ve configured the script as you want it, upload it somewhere and pull it up in your browser. What you should see is the dump of all the posts/comments in the date range you specified.
I then saved the HTML file to my local machine and opened it up in Pages. I’m sure other programs would work fine as well, but I prefer Pages over Word, and don’t know InDesign all that well.
Opening the file might take a while, depending on the number of posts/comments you extracted. Once the file was open I styled the imported CSS styles as I liked them, applying them globally. To do this, go to View -> Show Styles Drawer. As an example, reformat one of the post titles as you want it, then click on the arrow to the right of the style named “title”. From the drop down, select “Redefine Style From Selection”. This should change all the post titles in the document. Rinse and repeat for other styles as desired.
Pages didn’t import floated elements correctly, so I had to manually format my images so that they floated the text around them.
Once it’s formatted as you want it, simply export it as a PDF and use a service such as Lulu to print!
Download: blook.zip - unzip, remove .txt extension, and upload to your server after configuring.
Enjoy! If you come across any bugs please let me know. Also feel free to modify the script to your heart’s content. It’s license-free. Yum!
UPDATE: This script is now UTF8-compliant and will work for all Wordpress blogs, including those that require UTF8. Thanks to Ken.
Possibly related posts:- Sustain’d Launch
- Rand on Money
- Utah Voters and Political Naiveté
- Darfur Needs Oil
- Congress and the Sunlight Rule
21 comments so far. Care to chime in?
Hmmm.. Apparently lulu.com has an upper limit of 740 pages for its books. My posts from 2006 (with comments) ended up being 1328 pages long. Drat.
#2 Michael L. Mc Kee on January 27th, 2007Connor
Your post leaves me absolutely in the dark as I have no idea what you are talking about, and am therefore speechless.
Michael,
You’ll have to forgive the indulgence of my nerdy side, something I don’t show too often on this blog, as I tend to stick to political/religious topics. I promise it’ll be a long time before I post something technical again.
#5 Novelr.com - Making People Read - » Blook Plugin on January 28th, 2007[...] Boyack has released a pretty good interesting plugin yesterday in his blog. It basically pulls all the posts you have on a stand-alone wordpress install [...]
#6 Carolynn Duncan on January 29th, 2007Connor,
This is awesome. I’m trying it out. If you don’t mind, I’ll probably send you a tech support question or two.
I’m a newbie.
#7 Nathan on November 22nd, 2007I just tried to download the script but I’m getting a mysql_connect() error.
Could you fix this so I can get your script?
Thanks!
–
Nathan
Nathan, the link has been updated to point to a zip file instead. Save that to your computer and that should be usable.
#9 Blooking : Simplicitas | Ken Liu on January 28th, 2008[...] personally recommend Connor Boyack’s blooking script, which extracts posts from a specified date range and wraps the relevant blocks in CSS styles that [...]
M&M,
As the post notes, this is only for Wordpress.
Hosted blogs (on blogspot.com and wordpress.com) prevent access to the full database, and usually only allow you to export the data in a proprietary format that would have to be parsed through… A project for someone else, perhaps.
#12 m&m on January 29th, 2008sorry…missed that. Obviously, I’m not a techie. I finally get it, though.
#13 chelle on February 21st, 2008I clinked the link and was sent to a garbled page … is this script still available? I am very interested in trying it out
Thanks
#15 chelle on February 21st, 2008lol ok, I think I must be doing something wrong … I click and it WORKS! w00t and then I am …. what the … hehe Thanks for updating the link. I look forward to playing around with the script! Seriously thought I was going crazy loco!
#16 Beth on February 22nd, 2008I see my husband left a comment above — that was a long time ago now.
![]()
Just wanted to thank you for the script you wrote! I saw a blook service on a friend’s page but it used Blogger — so I asked around to my technologically-gifted friends and my brother Alex quickly got back to me with this post. My husband (Nathan) then used your script to print out my blog. It was the best birthday present ever — I am so excited! Thanks so much for sharing this!
Already a few of my blogger-friends with Wordpress have asked about it — I am referring them over here. Thanks!
#17 John on March 3rd, 2008Thanks for the script… worked like a charm on my wife’s blog. Just submitted a 490 page blook of our family to Lulu.
Lulu wouldn’t accept the PDF exported by Pages (lulu evidently doesn’t support the Mac 10.4.11 PDF encoding from Pages 08). I re-uploaded as a .doc, and worked fine. Odd.
I’ve been trying to accomplish this seemingly simple task for about 3 months. Thanks a million!
John
#18 Daisy Chain » Birthday Present on April 30th, 2008[...] to add the link to Connor Boyack’s post regarding the script — this is actually what we used, though keep in mind that Nathan tweaked the code a bit to [...]
#19 O’DonnellWeb - This is not a homeschooling blog » Blog Archive » links for 2008-06-17 on June 17th, 2008[...] Connor’s Conundrums » Making a Blook with Wordpress and Pages (tags: blogging books wordpress) [...]
#20 Karl on July 11th, 2008Thanks so much for posting this!!!!! You saved me a TON of work. You’re great. The only glitch I ran into was that lulu wouldn’t accept a Pages document nor would it accept a PDF that was created from Pages. So, I had to export my Pages document as a Word document and then it worked fine.
#21 Jeff T. on October 17th, 2008So, is there an easy way to do this for wordpress.com blogs? Or should I just covert to wordpress.org… since I know I will eventually someday anyways…
Post a comment
what's new
Featuring 615 posts w/ 7,586 comments.
Search the blog
Recent Comments 
- Jesse Gavin on Social Security Sucks
- Daniel on Who is Joseph Addison?
- Curtis on The Lesser of Two Evils
- Brian Mecham on The Lesser of Two Evils
- tracy m on Who is Joseph Addison?
- Adrien on Who is Joseph Addison?
- Kelly W. on Council on Foreign Relations
- Jeff T. on Council on Foreign Relations
- Kelly W. on Council on Foreign Relations
- Jeff T. on Council on Foreign Relations
- Kelly W. on Council on Foreign Relations
- Carissa on Council on Foreign Relations
- ajax on The Lesser of Two Evils
- Adrien on The Lesser of Two Evils
- Connor on The Lesser of Two Evils
- View extended list »
Most Commented
- Why Do Latter-day Saints Ignore Ron Paul? (329)
- Why I'm For Ron Paul and Against Mitt Romney (254)
- The Protected Class of Sexuality (150)
- Religion and Politics: The LDS Church and Proposition 8 (120)
- Council on Foreign Relations (120)
- FLDS Petition Conclusion (120)
- Health Care Hocus Pocus (115)
- Harry Reid Against the "Right Wingers" (114)
- Brigham Young on Public Education (113)
- Domestic Enemies of the Constitution (113)
- Media Blacklisting Ron Paul (110)
- On President Hinckley's "War and Peace" (106)
- Monarchial Remnants (103)
- The Rights of an Embryo (98)
- Some Questions on 9/11 (95)
- Constitutional Questions (85)
- The Bare Minimum (79)
- True Competition in the Educational System (75)
- Weighing in on the Utah Voucher Program (74)
- Virginia Tech and Gun Control (74)
- View extended list »
Recent Posts
- The Lesser of Two Evils
- A Campaign Without Cash
- Who is Joseph Addison?
- Principle in Practice
- The Conspiracy Element of History
- Religion and Politics: The LDS Church and Proposition 8
- The Inherent Immorality of our Banking System
- Apathetic Until It Hits Your Wallet
- Domestic Enemies of the Constitution
- CotM: Invisible Children
- The Laws of Wickedness and America's Demise
- The Bigger They Are, The Softer They Fall
- Police Glorification
- We Will Never Forget
- Chaffetz v. Spencer: Round 1
- On Claims of Alienation
- A Snapshot of a Community's Preparedness
- The Rights of an Embryo
- The Child Soldier
- CotM: Smile Train
- View extended list »
Aaaaarchives
- October 2008 (8)
- September 2008 (10)
- August 2008 (8)
- July 2008 (9)
- June 2008 (10)
- May 2008 (7)
- April 2008 (9)
- March 2008 (12)
- February 2008 (10)
- January 2008 (11)
- December 2007 (11)
- November 2007 (14)
- October 2007 (12)
- September 2007 (10)
- August 2007 (20)
- July 2007 (7)
- June 2007 (13)
- May 2007 (21)
- April 2007 (24)
- March 2007 (26)
- February 2007 (23)
- January 2007 (29)
- December 2006 (34)
- November 2006 (55)
- October 2006 (63)
- September 2006 (27)
- August 2006 (32)
- July 2006 (68)
- June 2006 (26)
- January 2006 (1)
featured shtuff
PORTFOLIO
Web/print design and development (and other stuff!), done right.
QUOTY
Save and tag your favorite quotes, and share w/ your friends!
LIBERTY LUNCH
Mixing patriotism, conversation, and good food. Join us!
LEADERSHIP EDUCATION
To build men and women of virtue, wisdom, diplomacy, and courage who inspire greatness in others and move the cause of liberty.
CONGRESS
Time to boot the sycophants out of office and clean house!
POLITICAL RESTORATION
Restore the Republic! Join the Ron Paul Campaign for Liberty.
BOOK LIST
Here's what I'm currently reading.












