Archive for Bloggishness

Gannett: Week 9

This summer’s internship is over, but the project isn’t finished. They’re close. The only obstacle preventing launching the new website Monday is transferring the domain name, which requires OSU to review some paperwork.

The current estimate of The Lantern’s launch is August 30, during the first football game.

This week:

  • added categories for photos and Buckeye TV
  • uploaded the classified section
  • uploaded the interactives directory, including timeline stories made by Liz Young and myself.
  • wrote documentation for editors on:
    • posting new stories
    • uploading images
    • creating users
  • transferred some old stories from the old website to the new
  • handed the rest of the transfers off to Jay
  • set up email blast signup and un-signup forms
  • gave OCIO the email blast template for testing; received praise from our OCIO contact about the email template tool I wrote.
  • posted the Involvement Fair ad
  • various small CSS tweaks for readability and style
  • fixed the search bar’s placeholder text not actually being a placeholder

I’ve turned in documentation and the list of outstanding issues, and will be gathering my work into a portfolio.

This internship has been a tremendous learning experience. I’ve picked up some PHP and Js, have expanded my knowledge of CSS, adopted Bootstrap, learned some of the ins and outs of WordPress, and gained new appreciation of the planning fallacy.

Outside of this project, I’ve been putting CSS skills to work on creating (as-yet-unpublished) themes for the Dropplets blogging platform. I also have some projects planned that would use my new PHP knowledge. And once Bootstrap 3 settles into a release format, I plan on creating some themes for that.

 

Gannett Week 8

Next week is the last week of internship work before I leave town for a week. The site will need to be ready by then.

What I did this week:

  • Solicited feedback from design editors on the site design. 
  • Created a webpage comparing various site design tweaks.
  • Solicited feedback from design editors on the YouTube sidebar plugin, and chose one.
  • Fixed theme so older posts would pull and embed images from the correct folder.
  • Enabled Akismet comment spam filtering, which required talking to corporate to get external API queries enabled. (This also affected the YouTube and Twitter plugins.)
  • Featured posts are now documented.
  • Miscellaneous CSS tweaks.

Gannett: Week 6

The WordPress database for the new site has been imported. At this point, the site could go live tomorrow if it really needed to.

However, there’s still a lot of work to do before it’s truly ready. I’ve only just started copying the settings over from Jay’s development site. Settings configuration was disrupted Thursday by a sudden 500 error, which appeared to be a plugin misconfiguration or a .htaccess problem. I had asked for FTP access to the server on Wednesday, and received it Friday. Turns out that the problem was a bad .htaccess – the site had been set up and configured in /wordpress/, but someone moved it to /, resulting in WordPress not being able to find any of its parts. One .htaccess edit later, and the site was back.

Next week entails getting all the settings done and convincing someone to regex the MySQL database to fix the links to the photos.

Gannett: Week 5

I finally have server access!

Things were getting a little tense this week as some promised dates were set and fell with no progress, but Wednesday brought the server’s IP address and some modifications to my /etc/hosts file.

The IT folks with Gannett got the server set up this week, and are in the process of migrating our database into the WordPress install. (They need to modify PHPMyAdmin’s config so it will accept file uploads of up to 512 MB. Our database contains more than 10 years of posts.)

Once the import is done, I’ll get to work on the site’s theme, and then The Lantern will have its new website.

 

Gannett: Week 4

The email template tool has progressed satisfactorily from last week. I haven’t shown it to the editors yet, but Dan Caterinicchia (The Lantern’s faculty advisor) and Jay Smith (The Lantern’s production manager and webmaster) have seen it and approve.

I’ve posted the email template tool to f.benlk.com, and If you’re interested, click there to view it. You can also check out a sample of all the current layout options.

The next milestone for the template tool will be adding an option to remove the bottom sidebar ad if none has been bought, allowing for full-width posts on the bottom.

Still no access to the server for the new website.

Gannett: Week 2

The server for the new Lantern website is not yet ready, so I’ve been working on other things, specifically the template for the email news blast, and a tool to help editors author it.

Along the way, I’ve brushed up on my CSS and HTML, and have picked up a bit of PHP and jQuery from Codecademy. My progress can be seen on my Codecademy profile.

The tool I’m working on for authoring the email blast has form and some functions. It has the option to create an arbitrary number of stories, and then use those to generate the HTML of an email to be fed into OCIO’s Bulkmail system.

So far, the generation is the problem. I’m getting better at JavaScript and jQuery, but I suspect that I shall end up taking the Codecademy JavaScript course.

I’ve also learned about and made use of the Twitter Bootstrap CSS library in my email template tool.

Gannett Internship

This summer, I’m going to be working an internship for my home paper The Lantern and their parent company, Gannett, on porting thelantern.com to WordPress. A short but reasonably detailed list of what needs to be done this summer:

Main theme setup:

At the start of the internship, I will be given access to a Gannett-hosted server with the database filled with stories, but no theme.

  1. Add the wp-davinci theme from 140.254.50.136/thelantern and put on the new server.
  2. Configure wp-davinci using settings from 140.254.50.136/wordpress
  3. Add the requisite code (from Jay’s email) to the theme so that images show up.
  4. Colorize the top menu, using the CSS hacks from 140.254.50.136/wordpress

Mobile theme configuration or setup

Depending on what Gannett wants done:

  • Edit the new wp-davinci theme for better readability and functionality on mobile devices, and decrease the number of articles on the front page of thelantern.com, or
  • Install and configure a mobile theme plugin.

This is to address Gannett’s concerns about the length of the front page on mobile devices.

Email blasts

This part of the internship will require the most time and learning on my part. Email blasts are weekly (and arbitrary) emails sent to The Lantern’s subscriber list. Roughly 30,000 people receive these emails, which are currently composed in College Publisher Pro.

I’ll create an email-blast-composition workflow, which will require much research into the viability of WordPress plugins, HTML templates, and possibly creating a tool from scratch.

Permalinks

When I moved benlk.com from WordPress to Pelican, I had to address the issue of broken links. I solved this by using htaccess and mod-rewrite, but that manual conversion process took an hour for only ~30 pages. The Lantern has thousands of pages, and I’m not sure what options are available. More research.

Teaching editors the new site

Towards the end of the summer, I’ll begin teaching editors the new website and the new work flows. This will take time, but they all took Nicole Kraft’s journalism courses, which covered the basics of WordPress. This will only build on that.

SEO and Google Analytics stuff

Just need to make sure that the Google Analytics and other SEO code snippets migrate to the new site.

Installing MediaGoblin on a HostGator shared server: Not Allowed

The following tutorial is a bastardized version of that given by MediaGoblin devs. It does not include setup for PostgreSQL. It does not include instructions on how to run MediaGoblin as a separate user, as you do not have permissions to do that on HostGator servers. MediaGoblin will run as your account. This process requires calls or chats to customer support. Prerequisites:

  • Shell access to your shared-host Linux HostGator account
  • Working knowledge of the shell

Steps:

  1. ssh -p 2222 accountname@yourdomain.com
  2. cd to the directory you want MediaGoblin to be set up in. This should be in public_html. If you’re in ~, Mediagoblin will be set up in ~/mediagoblin, and will not be visible to the web.
  3. git clone http://gitorious.org/mediagoblin/mediagoblin.git
  4. cd mediagoblin
  5. Contact customer support. Tell them that you would like to have a virtualenv set up in (output of pwd) on (output of uname -n). They will need to use the command virtualenv --system-site-packages . || virtualenv . You may have to escalate or file a support ticket.
  6. Once the virtualenv is set up, python and its associated files will be installed in ~/bin/
  7. ~/bin/python setup.py developThis step will fail with the following error:

    Running py-bcrypt-0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BWVzJ5/py-bcrypt-0.2/egg-dist-tmp-U3y69Y
    unable to execute gcc: Permission denied
    error: Setup script exited with error: command 'gcc' failed with exit status 1

  8. Given that this will happen, you’ll have to contact customer support again. Tell them that you experienced whatever error you got (most likely related to gcc) and you would very much appreciate it if they pretty please would run the setup script for you.

Update after the break. Read more

Sadface: now on GitHub

That’s all there is to say, really.

For more on sadface, read the readme.

A script for cleaning text for sadface

This Bourne shell script takes text files like Cory Doctorow plaintext books and turns them into one-sentence-per-line files that sadface likes to read.

Code

#!/bin/bash
#
# uses args $1 $2 $3
# usage:-$ sed-cleaning.sh inputfile temporaryfile outputfile

# Get rid of unicode crap
cat $1 | tr "\r\n" " " > $2 # All hail http://www.unix.com/41858-post5.html

# run this with sed -nf sed-cleaning file.txt

sed -e 's/Mr\. /Mr /g
s/Mrs\. /Mrs /g
s/\x0A/\n/g
s/\n\n/\n/g
s/\.\n/\. /g
s/\n/ /g
s/\n /\n/g
s/\n /\n/g
s/\n /\n/g
s/\n /\n/g
s/\. /\. /g
s/\. \. \./\.\.\./g
s/ \./\./g
s/"//g
s/\. /\.\n/g
s/_//g
s/Mrs /Mrs\. /g
s/Mrs\.\. /Mrs\. /g
s/Mr /Mr\. /g
s/Mr\.\. /Mr\. /g' <$2 >$3

Example

Using the following passage from Doctorow’s A Place So Foreign and Eight More:

“Mama, I’m _not_ a super-villain,” Hershie said for the millionth time. He
chased the last of the gravy on his plate with a hunk of dark rye, skirting the
shriveled derma left behind from his kishka. Ever since the bugouts had inducted
Earth into their Galactic Federation, promising to end war, crime, and
corruption, he’d found himself at loose ends. His adoptive Earth-mother, who’d
named him Hershie Abromowicz, had talked him into meeting her at her favorite
restaurant in the heart of Toronto’s Gaza Strip.

sed-cleaning returns:

Mama, I’m not a super-villain, Hershie said for the millionth time.
He chased the last of the gravy on his plate with a hunk of dark rye, skirting the shriveled derma left behind from his kishka.
Ever since the bugouts had inducted Earth into their Galactic Federation, promising to end war, crime, and corruption, he’d found himself at loose ends.
His adoptive Earth-mother, who’d named him Hershie Abromowicz, had talked him into meeting her at her favorite restaurant in the heart of Toronto’s Gaza Strip.

The original text was manually wrapped with a newline every 80 characters. Now it’s wrapped with a newline after every period, not including Mr. and Mrs. If you want detection of other titles, follow the format given for Mr. and Mrs.

Credits

Text from The Super Man and the Bugout used under a Creative Commons 1.0 Attribution-NoDerivatives-NonCommercial License.

linuxer_rh on the Unix and Linux Forums at Unix.com

paradigm from the Ohio State University Open Source Club IRC channel