Tag Archive for 'plugin'

26
Nov

MyNetflix20 (beta) how-to

A few days ago my family signed up for Netflix. I had some spare time to play over the Thanksgiving weekend, so I installed and set up MyNetflix2 on my blog. Here’s how I did it. These instructions cover installation of MyNetflix2.0 beta on my web server (running FreeBSD 4.8). YMMV

  1. Download and uncompress the plug-in: cd my_wordpress_dir/wp-content/plugins fetch http://amphichon.com/wp-content/media/mynetflix20b.tar.gz tar -xzf mynetflix20b.tar.gz
  2. The source file needs to be customized before it can be used. (I guess this isn’t technically a “plug-in” because of this.) First change needed is adding your personal Netflix RSS feed URL’s. To find these, login to your Netflix account and follow the link labeld “RSS” at the bottom of the Netflix page. Below the “Personalized Feeds” heading, you’ll find the RSS URL’s. Copy and paste them into MyNetflix source code.
  3. You may also need to modify other settings, particularly if you don’t have the “3-at-a-time” plan.
  4. Activate the plugin from the admin / Plugins page.
  5. Add some code to your WordPress theme (typically on a sidebar) to display however much of your queue, current DVD’s, and/or recent rentals that your wish. I’m using the code below to display the DVD’s we’re currently watching:
        <?php if (function_exists('mynetflix')) { ?>
            <h4><?php _e('Recent NetFlix Activity'); ?></h4>
            <?php mynetflix('out'); ?>
        <?php } ?>
    
  6. I’ll probably add some code to display recently returned DVD’s in the future. (We haven’t returned any discs yet, so this breaks the MyNetflix code right now.)

That’s all there is to it. I’m going to see if I can hack up an Options page for this code to make it a true plugin. This would handle the RSS ID string(s) and the $plan settings, and possibly the image layout options. If/when I finish that, I’ll send the changes to herichon for inclusion in the next release.

18
Nov

Who needs Blockbuster when Netflix is available?

Well, we finally got around to joining Netflix yesterday, and we’ve already got 60 movies in our queue! Initially we signed up for the 3-at-a-time plan, but we’ll probably change to the cheapest plan once the novelty wears off.

Several of our friends already use Netflix, and they all had good things to say about the service. The only words of caution I received had to do with “throttling” of the movie pipe. This is spelled out in the terms of service, and basically says that if you burn through your queue they reserve the right to take their time sending your next movie. Fair enough, I guess.

Of course, this gives me another feature to hack/play with here on the blog: displaying our Netflix queue and/or recent activity. I was initially thinking of using Jimbo’s mynetflix 1.5 plugin, but he’s been pretty busy lately. It looks like development work has been taken over by Herichon, who recently released mynetflix2. I’ll be fiddling with this plugin and squeezing it into my page somewhere. Of course, this is going to be another customization that needs to be maintained for each theme, sigh.

If you’re a Netflix user reading this blog, feel free to add us (my wife and I) to your friends list. Our Netflix address is netflix@thisblogsname.net (In case that’s not clear enough, you’ll need to replace thisblogsname with SonicChicken.) My wife and I also have personal profiles to cover movies that we disagree about, for example I like Dr. Strangelove and she doesn’t. If you want to add us individually use our name instead of “netflix” in the account, e.g. jim@thisblogsname.net.

31
Aug

Footer plugin requirements, notes

A few days ago, Joseph and I were talking about bolting statcounter onto our blogs. He’s the one that pointed out statcounter to me, and all he needed to do was add the statcounter script to his theme’s footer.php file. This would probably work for any single-theme site, but I’m still running multiple themes on my blog. I need to do one of the following if I want to use statcounter:

  1. Drop all but one theme. There are several good reasons for this, most important of which is maintenance. This would allow me to add the statcounter script to the remaining theme’s footer.php and I’d be done.
  2. Add statcounter to all my themes. This probably wouldn’t be too bad, except for maintenance–whenever a new version of one of my themes came out, I’d have to manually reapply my changes.
  3. Write a plugin to insert the statcounter script in the footer of every page. This would be the most work up front, but it would give me a good excuse to learn how to write plugins for WordPress.

I found some useful resources for plugin authoring. The WordPress codex has a section on writing plugins. Owen’s tutorial is a great introduction–just read it and start hacking! :) Carthik’s Plunge into Plugins article has lots of good advice, but isn’t a tutorial–check it out after/while you get started with Owen’s page. More good info is available on the Codex page Writing a Plugin.

I’ve started working on this plugin, and I’ve already been bitten by the “extra blank line” problem. (Admin interface was reporting “Cannot modify header information - headers already sent by…” error. Note to self–scroll to the bottom of each PHP file, and make sure the PHP close tag is right at the bottom of the file.) I have the code to insert arbitrary text into the footer, but I still need to add the Options menu which would allow J. Random User to edit the text to be inserted. (Right now, the text is hard-coded in the “plugin”, which I have installed and activated on this blog. Check the bottom left corner of any blog page for the statcounter.)

I don’t see any reason for this plugin to be statcounter-specific. It would be more useful to provide some sort of generic footer plugin which would allow HTML or javascript to be inserted in the footer. We’ll see how it goes. If I’m happy with it by the end of the night or later this week, I will go ahead and release it.

14
Aug

“Recent comments” added

I had a few folks post comments on some of my older posts, and I didn’t notice them right away. The problem is that I rarely use the WordPress “dashboard”, which is the easiest place to find recently added comments.

For several weeks, I’ve been meaning to bolt the Recent Comments plugin by Krischan Jodies’ onto the Journalized-Blue theme that I use. So I’d like to thank jim wilde, Bitcloud, and RTO Trainer first and foremost for commenting on my blog. Additional thanks are due for giving me the best incentive to get off my butt and get the necessary hacking done! While I was at it, I made some minor cosmetic changes to the interface, the most visible being the longer “top tags” list.

08
Jul

Adding statcounter to WordPress

I’m thinking about using the free statcounter service on my site, but it requires that I add a little bit of javascript to each page. If I was running a single theme, I could probably find all the appropriate </body> tags and just paste in the statcounter code. But I’m trying to support multiple themes; besides, where’s the fun in cutting and pasting a bunch of code? Also, what if I need to change the statcounter code for some reason? So I think the Right Thing to do here is come up with a plugin for the wp_footer action which will insert some user-specified code, (in this case, my statcounter javascript). I haven’t found a plugin for statcounter, so I’ll be searching for a generic footer plugin. If I can’t find anything, I guess I’ll have to roll my own.




March 2010
M T W T F S S
« Dec    
1234567
891011121314
15161718192021
22232425262728
293031  

Tags

a wok for all seasons abramoff accessibility acetylene active directory activism adodb aerial photo afrofunk aim4tree air america airport express alite alito amtrak andante andy antenna anti failure any browser apache appetizer apple apple pie applescript arden arcade arden park ariana arnold artichoke ashland astronomy attic attika audio avid reader backup baen bart bash batch bathroom bbq bee beef begonia bgg bike bike hikers bike journal bikejournal biketalk bill oreilly bittorrent blacklist blog bloggercode blogroll blueberry boardgamegeek boardgames bonjour book bookcrossing boot failure bootcamp borderline chaos bugmenot bush business card butter cabinetry caira caitlin california callsign candamir caroline carpet cat cateye cdrom celebration cellular phone century cfengine cheese chicken chico chimney chinese chipotle chocolate christmas chumby city bikes civilization cjd claire club club fed co op coconut coffee comfort food community computer concord congress conquest conservation consumer reports copyright costco crazybikerchick crepe crock pot cruftbox css csus curl currency custard cvntrak dagoba daniel goetz darwinports database datarescue date format death delicious monster democracy now Democrat demolition dessert dhcp dickens diff disaster discrimination discworld dishwasher disk mirror diskutil diskutility diskwarrior dixie belle dock doors downing street memo drm dryer drywall dtv dump ed burke eff eggs eject election electric car electric truck electrical electricity elvgren emacs email energy efficiency eric meyer esr etext euthanasia facebook family faq faux news fcc feed feedreader fence finder firefox fireworks first4internet first amendment fishmeal flash flickr flooring fondue foreign exchange foundation fox and goose framing freebsd freedback freetds fsck fundraiser fyq garage garden geek geotag geourl ginger gnutar go gonuls google google earth google maps gpl gracenote graywater greek green group concat gtd gunthers gutters gwbush gymnastics hacking halloween ham ham radio handspring hardwood harry potter headmeta heimdal high speed photograph high tech inv hoax hobbies hobby hodgins holiday holly home power magazine horcrux houseblogs how to html humor hvac ilovejackdaniels imac impeach init inspection insulation intel internet iostat ipod ipodder iq iraq isight iso itunes ivins iwantsandy java city javascript jean reno jet lag joint chiefs joseph jott journalized blue judges cup juliette binoche kctc kerberos khs kimkerry kitchen kyocera la salles la times labor landscape laundry law leatherbys legal lego leopard lhc liberal library linkedin ljurban lodi logic logo lungren lynx maaloufs mac macaroni macbook mafc mailinator make.conf malware map marin markdown martin yan mason media media clip media reform meetup metric mexican microsoft mike comfort military milonic mindstorms mlk model railroading modoc hall monterey morning sedition motorcycle movie moving mssql munchkin murray mushroom music mynetflix mysql n3jim nagios naked lounge nerd score netflix network new urbanism new year New Yorker nofollow nut nutella oatmeal obama obcz occidental occupation omni openssl oracle organic osx owp paint pair palast palm panasonic parallels party patch peak adventures peak oil pear pedestrian village perl petaluma php ping pingback pingomatic pingomation pingqueue pirate pl sql planet bike plasma playroom entertainment plugin plugin:preview theme plugin:text control plugin:ultimate tag warrior plumbing podcast podsite politics portaudit portmaster ports portupgrade postfix potato powerbook Pozsars printer programming project gutenberg pryde punk puzzle qiana qrz quilt quilt shop quiz quote r5 records racism radio RAID railroad recent comments recipe redalt remodel repairmirror resaurant resolution restaurant restore review richmond rio americano robotics roger niello ron montana roof rootkit rss sacbee sacog sacramento sacramento spotlight magazine salad samba san francisco sandwich santa cruz scam scandal school days scplugin screen security session report shakespeare shuffle sigma siriradha sitemap slim jim snl snopes social social network software soma somafab sonicchicken sonicchicken blog sony spam spam karma spellcheck spinach spinner spirit spoiler etiquette spring hill cheese sql sqlserver stairs standards statcounter stephen king stop loss stucco stunt subversion sudo sudoku superbowl superhero supreme court sushi svn sysadmin tacoma tags plugin takara technology telephone television template terms and conditions textcontrol thai kitchen thanksgiving the well seasoned wok theater theme theme:borderline chaos theme:elvgren theme:elvgren wordpress google code theme:fluid blue theme:fullwidth theme:head theme:journalized theme:journalized blue theme:psycho theme:redoable theme:sharepoint like theme:simple green theme:spirit theme:steam theme:wuhan theme:yadda theme switcher thomas tigris euphrates tile tinfoil hat toc tofu tower theater training transit transit oriented development tribute u haul uneasy rhetoric university village unix ad notes ups van zant veal veterans day video vie viking hobby vote smart w3c wall warboss washer washington post weather web web developer web server wikipedia windows windows server 2003 wishlist woodworking wordpress workplace wpblacklist wpgatekeeper wsj xserve yaaarr yard