Category Archives: In Development

My first Greasemonkey Script

flickr_logo_gammaIt’s been years since I did any Javascript programing, but I had a simple problem and decided to dive into it.

Like many of the little programs I write, I had a “problem” and wanted to solve it. I wanted a convenient link on the photo page to cut and paste the short URL of FLickr Images.  Look at this URL for a nice photo my wife took:

http://www.flickr.com/photos/s_d/3665619548/

As a URL goes, not too bad, but suppose you wanted to insert the link in
Twitter or Facebook? It’s a little verbose.  Wouldn’t this be better?

http://flic.kr/p/6zVfZ3

Yep, I think so too and so does Flickr:
http://www.flickr.com/services/api/misc.urls.html#short
http://www.flickr.com/groups/api/discuss/72157616713786392/
This thread showed how to do it: http://www.flickr.com/groups/api/discuss/72157616713786392/

The FlickrBase58 function in the script was written entirely by ‘Xenocryst @ Antares Scorpii’
http://www.flickr.com/people/antares/

Other than reformating, taken verbatim from link here
http://www.flickr.com/groups/api/discuss/72157616713786392/72157620673064673/

The Original way *I* wrote it was to retrieve the HTML, Parse it for
<link rev=”canonical” type=”text/html” src=”//flic.kr/p/6zVfZ3″ >

And use that link. While fun to write, that’s the wrong way to do it so I rewrote it to use the function written by ‘Xenocryst @ Antares Scorpii’ .  When installed on Firefox running the Greasemonkey extension, it will insert a link on the page on the right side just under “Flag your photo” that says:

The Flic.kr link is: http://flic.kr/p/6zVfZ3

This will allow you to right click the URL, copy it and paste into Twitter or Facebook.

Here is the script.

NOTE: I’m pretty certain it’s harmless, but use at your own risk. It’s hardly great programming and I’m sure someone else would have done it too, if not better.

Music I’m listening to right Now:
Paralyzer ” by Finger Eleven from the “Them VS. You VS. Me” Album.

Modifying PageView Plugin for my needs

Recently, I needed to insert an IFRAME into a post. I could just insert the IFRAME code into the post, but the Tiny MCE editor chewed it up and occasionally would blow up. Looking for a WP Plugin that handles IFRAME’s, I came across John Godley’s PageView plugin. I like how it’s written and presented, but I wanted it take all the IFRAME parameters and not always have a header. So I modified the following files:
pageview/pageview.php
pageview/pageview.css
pageview/view/pageview/pageview.php

[pageview src=”//www.msnbc.msn.com/id/22425001/vp/23601329#23601329″ frameborder=”0″ height=”339″ scrolling=”no” width=”100%”]

Done via my modifications:
[ pageview src="//www.msnbc.msn.com/id/22425001/vp/23601329#23601329" frameborder="0" height="339" scrolling="no" width="100%" ]
If “src=” is in the plugin string, my modification will make an assumption that the entire string is the IFRAME parameters. As I don’t do any error checking, this could be potentially dangerous but it suits my needs.

[pageview http://www.msnbc.msn.com/id/22425001/vp/23601329#23601329 “Keith Oberman” Special Comment]

Done via original 3 parameters:
[ pageview http://www.msnbc.msn.com/id/22425001/vp/23601329#23601329 "Keith Oberman" Special Comment ]
This will use any defaults in the CSS file and in the case of the MSNBC IFRAME doesn’t work too good. This isn’t a deficiency of the plugin, it’s a good plugin doing exactly what it’s supposed to do. On top of that, the Code is well written and easy to read which made it easy for me to find the exact spot to modify for my needs.

Music I’m listening to right Now:
Big Bang Baby” by Stone Temple Pilots from the “Tiny Music…Songs From The Vatican Gift Shop” Album.

Testing Movable Type 3.31 with My plugins

 After Updating the DB via the command line (NOT a fan of a GUI update!) and following my own instructions on how to install my own plugin, So far so good.

After I'm happy with my Test Server results, I'll document each step I took. Each One Note: rebuild seems to take longer than the 3.2 version, but it might be just my perception as I'm not really timing it. 

Image from my Poor Editing of a "Built for Movable Type 3.2" banner…

Music I'm listening to right Now:
"Over My Head (Cable Car)" by The Fray from the "How to Save a Life" Album.

Update: Got my first "HTTP Error 500 – Internal server error"! This is reassuring since I'm running a server with less than the recommended Hardware specs. Everything looks ok, probably took too long for the Web servers liking. You can see the test server here.
 

MTGoogleMaps Slight update

Updated the Perl code a Little. Now uses Version 2 of the GoogleMaps API.
Still sick but If I lie down to rest, my head gets all stuffed up..

Update: Fixed Javascript code generation.
Update II: Testing Google Geocoder.
Update III: Google Geocoder works. Working on Multiple Markers

Music I'm listening to right Now:
"Stay on the Road" by Corrinne May from the "Corrinne May/Fly Away" Album.

MTYahooMaps – Slight Update


Took a look at the Yahoo Maps API Flash Docs and discovered that they updated the API to version 3. Seems to be a little more stable, so I’m adding some functionality to the MTYahooMaps Plugin I wrote. I’ve added a “mapsathyb” keyword that will take “map”, “sat” or “hyb” as Parameters.

Update: Got the bugs out and it seems to work well in the Flash version. Need to clean the code a little and figure out how to add a recenter button.

Another Update: Fixing the AJAX version. Also Switched to Yahoo Geocoder. Above is the Flash version and below, AJAX.

Yet Another Update: Just a comment really; I haven’t looked at the code in a long time. Even though I Commented it, it still took me a little to figure out Why I did somethings in the Perl Code…

You can get the Updated program here.


Music I'm listening to right Now
:
"All Eyes on Me" by Goo Goo Dols from the "Dizzy Up the Girl" Album.

MTYahooMaps – Multiple Markers

Only One Marker will show up but the log will reflect 2.
Hopefully.

Update: Should see 2 markers.
Done via:
<MTYahooMaps address=”11 Madison avenue,NY, NY, 10010″ info=”11 Madison Avenue Nice Place” width=”540″ height=”300″ zoom=”3″ address_1=”1 Madison Avenue,NY, NY, 10010″ info_1=”1 Madison Avenue New Condos..”></MTYahooMaps>

Update: Testing with New Version of YahooMaps API v 3.0

MTIFrames – Test 2

NOTE: This Map Can be found at http://maps.fiftythreedegrees.com/allnight.html

It’s a great map and I had NOTHING to do with it’s development. I’m using it for Testing as I need some good and complicated HTML to properly test my IFRAME MT Plugin. I’ll likely pull this entry when I’m done testing

Chek out http://www.fiftythreedegrees.com/

Update: The Plugin seems to work ok. Other then needing to put ” target=_top ” in the Links, it does what I want.

This entry was used these Plugin Tags:
<MTIFrames src=”//www.epyon-1.com/blog/stuff/allnight.html” width=”540″ height=”540″ align=”center” frameborder=”yes”></MTIFrames>

MTIFrames – Test 1

Should be Weather in NYC on the left.
This was done via the following:
<MTIFrames src=”//www.epyon-1.com/blog/stuff/weather.html” width=”135″ height=”90″ align=”left” frameborder=”yes”></MTIFrames>

MTYahooMaps Test 2 – Multiple Maps

This should be two Yahoo Maps, The Top is of 11 Madison Avenue The Bottom is of 499 Park Avenue.

Update: Well, it works Only on the Individual Archive page. For Now, No Multiple Maps on One Post. So, I pulled the 499 park Avenue Map.

Update: Seems I got it. The Above Maps show up in all Archive types properly.

Finally Got Both of them Working…

Ok, I got Both MTGoogleMaps and my New Plugin MTYahooMaps Working in both I.E. and Firefox. Can They work in the Same Post? On the Left will Hopefully be a Google Map of 11 Madison Avenue, on the Right, A Yahoo Ajax Map of 11 Madison Avenue…

Update: In Internet Explorer ONLY, Some of the Post shows up Between the Images. It’s a DIV problem solved by a clear:both. To make sure Everyone can see the two Maps, I put it at the Bottom.

Last Update: It works perfectly. I’ve added Latitude and Longitude Parameters since I was a little unhappy where the Geocoder put 11 Madison Avenue. This comming week, I’ll write the documentation for it.

These two maps were made with this Code Strung together:
<MTGoogleMaps address=”11 Madison avenue,NY, NY, 10010″
info=”A Nice Place”
width=”273″ height=”300″ zoom=”2″
zoomcontrol=”large”
maptype=”map” align=”left”
lat=”40.741453227756246″ log=”-73.98656845092773″>
</MTGoogleMaps>

<MTYahooMaps address=”11 Madison avenue,NY, NY, 10010″
info=”A Nice Place”
width=”273″ height=”300″ zoom=”3″
maptype=”ajax” align=”right”
lat=”40.741453227756246″ log=”-73.98656845092773″>
</MTYahooMaps>