<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>johnmu.com &#187; Tricks</title>
	<atom:link href="http://johnmu.com/category/tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnmu.com</link>
	<description>John Mueller's technical website tips and tricks</description>
	<lastBuildDate>Thu, 03 Dec 2009 12:42:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Confirm that you&#8217;re using Analytics on all pages</title>
		<link>http://johnmu.com/analytics-everywhere/</link>
		<comments>http://johnmu.com/analytics-everywhere/#comments</comments>
		<pubDate>Tue, 20 May 2008 23:27:09 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/analytics-everywhere/</guid>
		<description><![CDATA[Here&#8217;s something from my mailbox &#8211; someone wanted to know how he could crawl his site and confirm that all of his pages really have the Google Analytics tracking-code on them. WordPress users have it easy, there are plugins that handle it automatically. Sometimes it&#8217;s worth asking nicely   &#8211; let me show you [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something from my mailbox &#8211; someone wanted to know how he could crawl his site and confirm that all of his pages really have the <a href="http://www.google.com/analytics/">Google Analytics</a> tracking-code on them. WordPress users have it easy, there are plugins that handle it automatically. Sometimes it&#8217;s worth asking nicely <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8211; let me show you how I did it. As a bonus, I&#8217;ll also show how you can check the AdSense ID on your pages, if you&#8217;re worried that you copy/pasted it incorrectly.</p>
<p>This is pretty much cross-platform, but as a Windows-user you&#8217;ll have to grab and install two files first:</p>
<ul>
<li><a href="http://users.ugent.be/~bpuype/wget/">wget</a> &#8211; a tool to download copies of web pages</li>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=9328">UnxTools</a> &#8211; a collection of popular Unix/Linux tools for the hacker in you</li>
</ul>
<p>Extract the ZIP files, copy the contents somewhere where you can find it and make sure that the appropriate folders are in your &#8220;path&#8221; (the files you&#8217;ll need for UnxTools are in &#8220;&#8230;\usr\local\wbin&#8221;). We&#8217;ll need to access these tools through the command line. I have a feeling I may need to elaborate on that for Windows users <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8212; let me know if that&#8217;s the case.</p>
<p>First, we&#8217;ll mirror our site on our local machine (this assumes that your site is crawlable; if it isn&#8217;t, then fix it first <img src='http://johnmu.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ):<br />
<span id="more-135"></span></p>
<ol>
<li>Open a command box or terminal window (on Windows, hit Start / Run &#8230; and enter &#8220;cmd&#8221;)</li>
<li>Go to or create a temporary folder</li>
<li>Run the following command to mirror your site:
<p><code>wget --mirror --accept=html,htm,php,asp,aspx http://domain.com/</code></p>
<p>This command mirrors pages with .html, .htm, .php, .asp and .aspx extensions on http://domain.com/. It&#8217;ll create a folder for the domain and put all the files in it. Dynamic URLs will get adjusted so that they can be used as file names.</li>
<li>Wait &#8230; until it&#8217;s all downloaded &#8230; if it feels endless, you might have endless URLs, perhaps an infinite calendar script or something similar? It&#8217;s worth fixing!</li>
</ol>
<p>Alrighty, now that we have a copy of your site, let&#8217;s check things out. </p>
<h3>Finding pages without Analytics</h3>
<p>We can find pages without the Analytics tracking code by listing all pages which do not have certain content in them:</p>
<p><code>grep -r -L "google-analytics.com" *.*</code></p>
<p>This command goes through all subfolders (the &#8220;-r&#8221; option) and lists the files that do not contain a match (&#8220;-L&#8221;) for &#8220;google-analytics.com&#8221;. That could be extended to just about anything <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . </p>
<p>How about pages that don&#8217;t have a &#8220;description&#8221; meta tag?</p>
<p><code>grep -r -L "meta name=.description" *.*</code></p>
<p>The &#8220;.&#8221; (period) matches any character &#8212; in this case, it is used to match the &#8221; (double-quote). </p>
<h3>Finding pages with AdSense (and the ID used)</h3>
<p>Finding pages that contain a certain text is even easier:</p>
<p><code>grep -r "google_ad_client" *.*</code></p>
<p>Note that all we did was drop the &#8220;-L&#8221; (and change the text, obviously). It will show the lines that match this pattern in all of your pages, which includes the AdSense ID. </p>
<p>Similar to the earlier check for missing &#8220;description&#8221; meta tags, assuming you have the contents of that tag all in one line, you can easily find all of these meta tags with:</p>
<p><code>grep -r "meta name=.description" *.*</code></p>
<p>What would you like to search for today?</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/analytics-everywhere/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Running Firefox in parallel</title>
		<link>http://johnmu.com/firefox-multiplied/</link>
		<comments>http://johnmu.com/firefox-multiplied/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 23:14:39 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/firefox-multiplied/</guid>
		<description><![CDATA[Sometimes it would just be great to have multiple instances of Firefox running at the same time. Some web applications just love to eat memory in Firefox, some web pages go crazy if you have JavaScript enabled and sometimes you just want different sets of cookies to let you manage two accounts at the same [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it would just be great to have multiple instances of Firefox running at the same time. Some web applications just love to eat memory in Firefox, some web pages go crazy if you have JavaScript enabled and sometimes you just want different sets of cookies to let you manage two accounts at the same time. </p>
<p>I&#8217;ve been trying to do that for years and did the most exotic things to make it happen. I&#8217;ve used four different browsers in parallel and I&#8217;ve even used a virtual PC running within my PC (that kind of defeats the desire to use less memory, but it feels neat anyway). In the end, a collegue in the office, who happens to use emacs as his main web browser <img src='http://johnmu.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  , pointed me into the right direction. </p>
<p>Now I have three completely independant instances of Firefox running at the same time!</p>
<p><img src='http://johnmu.com/wp-content/stuff/moz3.gif' alt='3 little Firefoxen, running on a desktop' /></p>
<p>So what&#8217;s the trick?<br />
<span id="more-131"></span><br />
Firefox has <a href="http://kb.mozillazine.org/Command_line_arguments">command line options</a> to let you start multiple profiles and specify a certain one. In our case, we&#8217;re going to change the command line to:</p>
<p><strong>&#8220;C:\Program Files\Mozilla Firefox\firefox.exe&#8221; -no-remote -P NewProfileName</strong></p>
<p>To get started, check the name of your current profile. On Windows you can find it in &#8220;c:\Documents and Settings\[user-name]\Application Data\Mozilla\Firefox\Profiles&#8221;. It will generally have a few characters and numbers, a period and then the profile name (in my case it was something like &#8220;36fc232a.default&#8221;). Use this to adjust the settings of the icon you use to start up Firefox. On Windows, right-click on the icon and select &#8220;Properties&#8221;; you can add the options in the field called &#8220;Target&#8221;:</p>
<p><img src='http://johnmu.com/wp-content/stuff/moz-set1.gif' alt='Firefox profile settings' /></p>
<p>If you click on that icon now, it should start up Firefox just as before (ok, this is not the neat part yet <img src='http://johnmu.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ). </p>
<p>Now make a copy of the icon (I right-click drag it into a folder and select &#8220;Copy&#8221;) and change the command line options (and file name) again, only this time choose a different profile name. If you want to use a copy of your existing profile (with all cookies, bookmarks, themes and add-ons), you can do that by going into the folder where your profiles are stored (mentioned above) and copying your default profile. Now when you start up Firefox with that icon, it will bring the profile manager since it can&#8217;t find that new profile. Create a new profile and use the exact name you used in the options. You will then have a choice of either creating a completely new profile or using an existing profile folder. </p>
<p>Now you have two instances of Firefox running at the same time. They&#8217;re completely separate, so if one crashes, the other will continue normally. If one starts using too much memory, you can close it and restart it without impacting the other one. If you have conflicts with add-ons or want to use different cookie sets, just use a separate instance. </p>
<p>Since the various instances will generally look the same and be hard to keep apart, I just applied different themes to them. The &#8220;Safari-style&#8221; theme is my private one, the blue one is used for all my work-apps and the normal one is used for all kinds of testing. </p>
<p>This trick should work on all platforms with Firefox, not that I tried it out so try it at your own risk <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . Now if only I could migrate my IE profile back to Firefox &#8230; </p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/firefox-multiplied/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Go hack yourself &#8211; recovering your FTP password</title>
		<link>http://johnmu.com/go-hack-your-ftp/</link>
		<comments>http://johnmu.com/go-hack-your-ftp/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 16:05:20 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/go-hack-your-ftp/</guid>
		<description><![CDATA[All of the websites I put together at the moment are used for playing around and testing things. It&#8217;s fun to set up a site, try some things out, delete it or just let it sit and then &#8211; usually much later &#8211; start over and try something else. The only problem is that by [...]]]></description>
			<content:encoded><![CDATA[<p>All of the websites I put together at the moment are used for playing around and testing things. It&#8217;s fun to set up a site, try some things out, delete it or just let it sit and then &#8211; usually much later &#8211; start over and try something else. The only problem is that by the time I am ready to start over, I have forgotten my password. I can find my user name, it&#8217;s in the FTP client and visible in my hosting control panel, but the password is not visible anywhere. The secure way would be to just pick a new password, but let&#8217;s assume you need your old one <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  . The following will also work for email passwords stored in your email client, by the way. </p>
<p>What we&#8217;ll do is &#8220;sniff&#8221; the connection that your FTP client builds up, we&#8217;ll take a look at the packets sent out and received. Remember that other people can do this as well &#8211; say if you&#8217;re on an insecure wireless connection on the road &#8212; use secure connections and protocols whenever you can!<br />
<span id="more-126"></span><br />
You&#8217;ll have to get a copy of <a rel="oh come on" href="http://www.ethereal.com/download.html">Ethereal</a> (freeware), a universal network analysis tool (there are many similar tools available, I like the flexibility of Ethereal). Download it, install it and start it up. </p>
<p>To get started, select the menu item <em>Capture</em> and <em>Start</em>, then choose your ethernet interface (WLAN, cable, etc) and let it start. You are now recording your complete network traffic, you 1337 self-h4&#215;0r <img src='http://johnmu.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  . Depending on what you&#8217;re doing at the moment, it may record a lot of traffic. We&#8217;ll filter it later on, so don&#8217;t worry about that. </p>
<p><img src='http://johnmu.com/wp-content/stuff/thger6.png' alt='Ethereal capture in progress' /></p>
<p>Now start up your FTP client (make sure you&#8217;re not using a secure FTP connection) and connect to your server. When you connect to your server like that, you will send your user name and password over the network and Ethereal record that for you. Once you have that, you can stop capturing in Ethereal. </p>
<p><img src='http://johnmu.com/wp-content/stuff/ether1c.png' alt='Sniffed Ethereal connection' /></p>
<p>If you scroll through the data you collect like that, you&#8217;ll quickly notice that there&#8217;s a lot going over those wires. Let&#8217;s just look at the data going to and from our FTP server. You&#8217;ll have to get the IP address of your server (which you can usually do in a shell/command box by typing &#8220;nslookup ftp.yourservername.com&#8221;). In the filter box on top, enter: <strong>ip.addr eq nnn.nnn.nnn.nnn</strong> (where the &#8220;nnn&#8217;s&#8221; are the IP address of your server). </p>
<p><img src='http://johnmu.com/wp-content/stuff/ether-2-eq-ip.png' alt="Sniff your server's IP address" /></p>
<p>Once you only look at the data going to and from your server, you&#8217;ll see the authentication information right away:</p>
<p><img src='http://johnmu.com/wp-content/stuff/etherr3.png' alt='Username and password, hacked' /></p>
<p>Now that you see how easy it is to hack yourself, make sure that others can&#8217;t do the same with your account:</p>
<ul>
<li>If you&#8217;re using a wireless connection, <strong>always assume that others can listen in</strong> (even if you&#8217;re using your own access point with WEP or WPA encryption).</li>
<li>Make sure that you <strong>use a secure version of FTP</strong>. In general, they will encrypt your authentication information so that it will not be readable on your network. Double-check it with Ethereal, if you want to be sure.</li>
<li><strong>Change your FTP/email passwords</strong> after you have used them on an insecure connection like a hotel or airport wireless.</li>
<li>If you use a web-based email service, make sure that you are accessing the site with <a href="http://mail.google.com/support/bin/answer.py?answer=8155">HTTPS</a> and not HTTP. Most web-mail services allow that (though they may not activate it by default since it is a bit slower and is usually not needed on your home network). </li>
<li>Even if your FTP (or email) client encrypts passwords in the settings, they can still be read with the right tools.</li>
</ul>
<p>Stay safe!</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/go-hack-your-ftp/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How to use Google webmaster tools stats with Excel</title>
		<link>http://johnmu.com/webmaster-tools-script-1/</link>
		<comments>http://johnmu.com/webmaster-tools-script-1/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 00:34:42 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/webmaster-tools-script-1/</guid>
		<description><![CDATA[Google&#8217;s webmaster tools has a neat feature that lets you download your query and click statistics (once you have verified ownership of your site). The data you can get from there is quite comprehensive, but hard to break down for use in Excel. As a fun exercise I put together a small Python-script that takes [...]]]></description>
			<content:encoded><![CDATA[<p>Google&#8217;s <a href="http://www.google.com/webmasters/tools/">webmaster tools</a> has a neat feature that lets you download your query and click statistics (once you have verified ownership of your site). The data you can get from there is quite comprehensive, but hard to break down for use in Excel. As a fun exercise I put together a small Python-script that takes the CSV file downloaded from your webmaster tools account and turns it into new CSV files for queries and for clicks (both with the position numbers as well). </p>
<p>Python is a neat little programming language, I like it more and more as I use it <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .<br />
<span id="more-123"></span><br />
Here&#8217;s how to get started:</p>
<ol>
<li>If you do not have Python installed, go and <a href="http://www.python.org/download/">download and install Python</a>. I assume most Apple OSX will have it installed, but I don&#8217;t have a Mac so I can&#8217;t say for sure. It&#8217;ll almost certainly be installed if you&#8217;re one of the 3 Linux-users who have visited my blog. If you&#8217;re using Windows, take the version with the installer (it&#8217;s easier) and make sure that the folder where you installed Python is in your &#8220;path&#8221;. </li>
<li>Grab my <a href="http://johnmu.com/files/wmtextract01.zip">wmtextract01.zip</a> and extract it into a folder. You should have three files: wmtextract.py (the Python script) and ProcessAll.bat + ProcessAll.py.</li>
<li>Copy your query stats CSV files into that folder as well.</li>
<li>Double-click on ProcessAll.py (or ProcessAll.bat if you&#8217;re on Windows and don&#8217;t have Python set up to run scripts directly)</li>
<li>The script will now process all CSV files in the same folder, create a new folder called &#8220;output&#8221; and place the new CSV files there.</li>
<li>Open the new CSV files in Excel (or Open Office or even Google Docs + Spreadsheets)</li>
<li>Enjoy <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>Here are some more ideas for the CSV files when you have them in Excel:</p>
<ul>
<li>Select everything (Ctrl-A) and set up an &#8220;AutoFilter&#8221; (menu item Data / Filter / AutoFilter). Now you can filter your stats however you want them. Want to only see the queries for which you rank #1? How about the queries that people from Switzerland used to find your site?</li>
</ul>
<p><img src='http://johnmu.com/wp-content/stuff/excel-webmaster-tools.gif' alt='excel-webmaster-tools.gif' /></p>
<ul>
<li>Set the Location to &#8220;All locations&#8221; and search type to &#8220;All searches&#8221;, now select everything and sort by the last column (menu Data / Sort / has header row / sort by Column E, ascending). Now select the last two columns (D and E) and click on the chart icon. Choose an &#8220;XY scatter&#8221; chart and let it create it. This chart shows you the ranking of your site for the search queries. There are some problems with the chart like this (keywords can be listed several times), but I think it&#8217;s neat anyway <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </li>
</ul>
<p><img src='http://johnmu.com/wp-content/stuff/webmaster-ranking.gif' alt='webmaster-ranking.gif' /></p>
<p>What&#8217;s the neatest information you ever found in your webmaster tools query stats?</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/webmaster-tools-script-1/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>A set of command-line Windows website tools</title>
		<link>http://johnmu.com/web-toolbox-1/</link>
		<comments>http://johnmu.com/web-toolbox-1/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 22:51:42 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/web-toolbox-1/</guid>
		<description><![CDATA[If you have to do things over and over again, it&#8217;s a good idea to use a tool to make things easier. Windows is a bit limited (or very &#8211; when compared to Linux) when it comes to batch file scripts and &#8220;wget&#8221; is limited to what it can do right out the box, so [...]]]></description>
			<content:encoded><![CDATA[<p>If you have to do things over and over again, it&#8217;s a good idea to use a tool to make things easier. Windows is a bit limited (or very &#8211; when compared to Linux) when it comes to batch file scripts and &#8220;wget&#8221; is limited to what it can do right out the box, so I sat down and wrote a few command line tools to help me with some of the website checks that I like to do. </p>
<p>The tools I included in this set can do the following:</p>
<ul>
<li>Check the result codes for a URL (and follow in the case of a redirect) &#8211; or for a list of URLs</li>
<li>Create a list of the links found on a URL (or just particular ones)</li>
<li>Create a list of the links and anchor texts found on a URL (or just particular ones)</li>
<li>Create a simple keyword analysis of the indexable content on a URL</li>
</ul>
<p><span id="more-111"></span><br />
You can get the down from here (requires the Windows .NET runtime v1.1):</p>
<ul>
<li><a href="http://johnmu.com/files/WebToolbox.zip">WebToolbox.zip</a> (140kb)</li>
</ul>
<p><strong>WebResult</strong></p>
<p>This tool accesses a URL and shows the result code that was returned. If the status is a redirect, it will display the redirection location and optionally follow it to check the final result code. It may be used with a list of URLs. The output is tab-delimited.</p>
<p>Usage:<br />
<em>WebResult [options] (URL|urllist.txt)<br />
Options:<br />
 &#8211;referer|-r [referrer] (default: none)<br />
 &#8211;user-agent|-u [user-agent] (default: &#8220;WebResult&#8221;)<br />
 &#8211;follow-redirect|-f (default: not)<br />
 &#8211;headers|-h (displays the full response headers)<br />
 &#8211;verbose|-v</em></p>
<p>Example:<br />
Check for correct canonical redirect:<br />
 Webresult http://johnmu.com/<br />
 Webresult http://www.johnmu.com/</p>
<p><strong>WebLinks</strong></p>
<p>This tool lists the links that are found on a URL. Note that it has an integrated HTML/XHTML parser &#8211; if the code on the page is not fully compliant, there is a chance of the parser not recognizing all links (it is fairly fail-safe, though). </p>
<p>This tool can use a cached version of the URL (from either this tool or one of the other ones) to save bandwidth. The cached versions are saved in the user&#8217;s temp-folder. </p>
<p>You have the choice of only listing domain outbound or insite links (to help simplify the output). Additionally links with the HTML microformat &#8220;rel=nofollow&#8221; may be marked as such. The output is in alphabetical order. </p>
<p>Usage:<br />
<em>WebLinks [options] (URL|urllist.txt)<br />
Options:<br />
 &#8211;referer [referrer] (default: none)<br />
 &#8211;user-agent [user-agent] (default: &#8220;WebLinks&#8221;<br />
 &#8211;insite-only|-i (default: both in + out)<br />
 &#8211;outbound-only|-o (default: both in + out)<br />
 &#8211;ignore-nofollow|-n (default: off)<br />
 &#8211;cache|-c (default: off)<br />
 &#8211;verbose|-v (default: off)</em></p>
<p>Example:<br />
Check the outbound links on a site.<br />
 WebLinks -o http://johnmu.com/</p>
<p><strong>WebAnchors</strong></p>
<p>This tool lists the links and anchor text as found on a URL. It uses the same HTML/XHTML parser as WebLinks. It can be used to find certain links (based on the URL, domain name, URL-snippets, or even parts of the anchor text). If the anchor for a link is an image, it will use the appropriate ALT-text, etc.</p>
<p>Usage:<br />
<em>WebAnchors [options] (URL|urllist.txt)<br />
Options:<br />
 &#8211;referer|-r [referrer] (default: none)<br />
 &#8211;user-agent|-u [user-agent] (default: &#8220;WebLinks&#8221;<br />
 &#8211;find-url|-f http://URL<br />
 &#8211;find-domain|-d DOMAIN.TLD<br />
 &#8211;find-anchor|-a TEXT<br />
 &#8211;find-url-snippet|-s TEXT<br />
 &#8211;url-only|-o (default: show anchor text as well)<br />
 &#8211;skip-nofollow|-n (default: off)<br />
 &#8211;cache|-c (default: off)<br />
 &#8211;verbose|-v (default: off)</em></p>
<p>Example:<br />
Check the links with &#8220;Google&#8221; in the anchor text.<br />
 WebAnchors -s &#8220;Google&#8221; http://johnmu.com/</p>
<p><strong>WebKeywords</strong></p>
<p>This tool does a simple keyword analysis on the indexable content of a URL. It also uses the above HTML/XHTML parser to extract the indexable text. It is possible to get single-word keywords or to use multi-word-phrases. The output is tab-delimited for re-use. </p>
<p>Usage:<br />
<em>WebKeywords [options] (URL|urllist.txt)<br />
Options:<br />
 &#8211;referer|-r [referrer] (default: none)<br />
 &#8211;user-agent|-u [user-agent] (default: &#8220;WebLinks&#8221;<br />
 &#8211;verbose|-v (default: off)<br />
 &#8211;words|-w [NUM] (phrases with number of words, default: 1)<br />
 &#8211;ignore-numbers|-n (default: off)<br />
 &#8211;cache|-c (cache web page, default: off)</em></p>
<p>Example:<br />
Extract 3-word keyphrases from a page:<br />
 Webkeywords -w 3 http://johnmu.com/</p>
<p><strong>Combined usage of these tools</strong></p>
<p>Find common keyphrases on sites linked from a page (uses a temporary file to store the URLs):</p>
<p>    webanchors -c -o -a &#8220;Google&#8221; http://johnmu.com >temp.txt<br />
    webkeywords -c -w 3 temp.txt</p>
<p>Check result codes of all URLs linked from a page:</p>
<p>    weblinks -c http://johnmu.com >temp.txt<br />
    webresult temp.txt >links.tsv</p>
<p>Compare result codes for multiple accesses:</p>
<p>    echo. >results.tsv<br />
    for /L %i IN (1,1,100) DO webresult http://johnmu.com/ >>results.tsv</p>
<p>  or more complicated to test a hack based on the referrer (all on one line):</p>
<p>    for /L %i IN (1,1,100) DO webresult -u &#8220;Mozilla/5.0 (Windows; U) Gecko/20070725 Firefox/2.0.0.6&#8243; -r http://www.google.com/search?q=johnmu http://johnmu.com/ >>results.tsv</p>
<p>I&#8217;d love to hear about your usage of these tools <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . </p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/web-toolbox-1/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Check your web pages for hacks and unauthorized changes</title>
		<link>http://johnmu.com/page-changes-batch/</link>
		<comments>http://johnmu.com/page-changes-batch/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 23:12:14 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/page-changes-batch/</guid>
		<description><![CDATA[ Websites have become popular targets for hackers, who either try to add elements that automatically download &#8220;malware&#8221; (viruses, etc) or try to add hidden links (SEO hacking) to other websites. Quite often, these kinds of changes are not recognized by the webmaster or website owner. You could wait until a visitor complains to you [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://johnmu.com/wp-content/stuff/hidden-links.jpg' alt='hidden-links.jpg' style="float:left;" /> Websites have become popular targets for hackers, who either try to add elements that automatically download &#8220;<strong>malware</strong>&#8221; (viruses, etc) or try to add <strong>hidden links</strong> (SEO hacking) to other websites. Quite often, these kinds of changes are not recognized by the webmaster or website owner. You could wait until a visitor complains to you or you receive a mail from Google for spreading malware (or having hidden links to &#8220;bad places&#8221;), but that is slow, unreliable and usually too late.</p>
<p>There are services available that can track changes on your web pages automatically, but sometimes it is good to have something like that within your own control (or perhaps as a backup to an online service). To keep a record of changes on web pages I have put together a small Windows batch-file that checks a list of pages and emails you with any changes found. Additionally, it will also email you when the server is not reachable. You could use the same tool to keep track of changes on third-party web pages.<br />
<span id="more-101"></span><br />
The download is available here:</p>
<ul>
<li><a href="http://johnmu.com/files/webcheck-bat/checkall010.zip">WebCheck Batch file v0.1</a> &#8211; 4kb / 18. Aug 2007</li>
</ul>
<p>In order to use this tool, you will need two additional downloads:</p>
<ul>
<li><strong><a href="http://www.gnu.org/software/wget/">WGET</a></strong> (to download web pages): you can get the Windows program files at <a href="http://xoomer.alice.it/hherold/">http://xoomer.alice.it/hherold/</a></li>
<li><strong><a href="http://www.blat.net/">BLAT</a></strong> (to send emails): you can download this at <a href="http://sourceforge.net/project/showfiles.php?group_id=81910">http://sourceforge.net/project/showfiles.php?group_id=81910</a></li>
</ul>
<p>Follow the instructions in the &#8220;<em>readme.txt</em>&#8221; within the ZIP file to install and set up this script. </p>
<p><strong>Note: As mentioned in the instructions, you cannot list URLs with parameters directly &#8211; you need to use <a href="http://tinyurl.com/">tinyurl.com</a> to create a short version, which can be listed.</strong></p>
<p>Once you have set the files up, make sure that the &#8220;checkurls.txt&#8221; file has the URLs that you want to track (as well as a short identifier) and then just doubleclick &#8220;checkall.bat&#8221;. You could also use the windows scheduler to automatically start that URL, or put a shortcut to it into your autostart folder to have it started whenever you log in. </p>
<p>One URL to test it with is <a href="http://johannesmueller.com/">http://johannesmueller.com/</a> &#8211; within that page the server embeds a counter as a HTML comment. The program should automatically signal that URL every time you start the program. If you include a URL like that within your list of URLs, you can be fairly certain that the program is working properly as long as you receive a notification for that URL.</p>
<p>The email sent to your account contains a listing of all changes (with line numbers) based on the windows tool &#8220;fc&#8221; (file compare). </p>
<p>The code (batch file) is released into public domain &#8211; but I would really appreciate a short notification of any changes that you might have done. Yeah, I know, batch files are sooo 80&#8217;s <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . It would be trivial (except perhaps for the file comparison) to convert this tool into something that runs standalone, but as a batch file almost anyone can modify it as they see fit, without any fancy programming environments installed. </p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/page-changes-batch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding user-friendly rel=nofollow markup (for IE too!)</title>
		<link>http://johnmu.com/userfriendly-rel-nofollow/</link>
		<comments>http://johnmu.com/userfriendly-rel-nofollow/#comments</comments>
		<pubDate>Sat, 28 Jul 2007 10:31:19 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/userfriendly-rel-nofollow/</guid>
		<description><![CDATA[The next step after adding CSS to highlight links with rel=nofollow is to give the user some information about what the  symbol and the dashed line mean. Since CSS will not allow you to add tooltips and links, we have to resort to some javascript trickery. The up-side to this is that it will [...]]]></description>
			<content:encoded><![CDATA[<p>The next step after adding <a href="http://johnmu.com/highlight-nofollow/">CSS to highlight links with rel=nofollow</a> is to give the user some information about what the <img src="http://johnmu.com/files/nofollow.gif" alt="nofollow symbol" /> symbol and the <span style="border-bottom: dashed 2px #ffa500">dashed line</span> mean. Since CSS will not allow you to add tooltips and links, we have to resort to some javascript trickery. The up-side to this is that it will also display the markup on older browsers like IE 6. </p>
<p>Adding this kind of markup to your site is pretty easy to do.<br />
<span id="more-88"></span></p>
<ol>
<li>Download the <a href="http://johnmu.com/files/nofollow-js/highlight-nofollow.js">script</a> and the <a href="http://johnmu.com/files/nofollow-js/nofollow.gif">nofollow image</a>. </li>
<li>Open the script file in a text editor (Notepad is fine) and adjust the settings on top:
<div class="igBar"><span id="ljavascript-3"><a href="#" onclick="javascript:showPlainTxt('javascript-3'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-3">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// settings, modify as desired</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myInfoPage =<span style="color: #3366CC;">"http://domain.com/nofollow-info.htm"</span>;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// local page with nofollow information</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myNofollowImg = <span style="color: #3366CC;">"http://domain.com/images/nofollow.gif"</span>;&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// source of nofollow image (check for full path!)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// warning must be html-formatted</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myWarnMsg = <span style="color: #3366CC;">"Beware: this link is potentially bad or not trusted! Click here to find out more."</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-3-->
</li>
<li>Upload the script and the image (place the image in the path you specified in your script), don't forget to create your informational page for the nofollow (I'm just linking to my <a href="http://johnmu.com/policy/nofollow/">nofollow-policy page</a>). </li>
<li>In your template, right before the closing "&lt;/body&gt;" tag, add a reference to the script. In a Wordpress theme you would add this to your footer.php, eg:
<div class="igBar"><span id="lhtml-4"><a href="#" onclick="javascript:showPlainTxt('html-4'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-4">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- nofollow highlighting --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"&lt;?php bloginfo('stylesheet_directory'); ?&gt;</span>/highlight-nofollow.js&quot; type=&quot;text/javascript&quot;&gt;<span style="color: #009900;">&lt;/script&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... <span style="color: #009900;">&lt;/body&gt;</span> ... </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-4-->
</li>
<li>Refresh your browser and check the results. I have a local <a href="http://johnmu.com/files/nofollow-js/nofollow-test.htm">test page</a> which shows it in action (and here's a <a rel="woah nofollow" href="http://en.wikipedia.org/wiki/LeChuck">nofollow'ed link</a> thrown in for good measure).</li>
</ol>
<p>Currently the code only adds the image and underline to links that contain a text anchor. This means that links with only an image as the anchor are not modified (but the CSS nofollow highlighting will still be displayed, so be careful if you use that and have image-only links with rel=nofollow). The code was tested on IE 6 and 7.0, Opera 9.01 and Firefox 2.0.0.5. </p>
<p>The code removes the rel=nofollow from the displayed page (it still remains in the static page) so that the different kinds of nofollow markup (including those you might have installed in your browser or with a browser plugin) do not create conflicts. Just to be sure: <strong>this script does not change anything on your actual pages</strong>, it only changes how the page looks to the user. A search engine crawler would not see these changes.</p>
<p>Advanced users can modify the markup that is added to each link, perhaps even use it to open a floating window on top of the current page instead of going to a separate page. </p>
<p>Current version is v1.0 - 2007-07-28</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/userfriendly-rel-nofollow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding &#8220;rel=nofollow&#8221; markup to your site</title>
		<link>http://johnmu.com/highlight-nofollow/</link>
		<comments>http://johnmu.com/highlight-nofollow/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 01:10:11 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://johnmu.com/highlight-nofollow/</guid>
		<description><![CDATA[I support the "rel=nofollow" HTML microformat as a way to mark links which might be problematic, whether they're clearly spammy, just not checked or even just sites that I don't really want to link to (but still want to provide a link for others to use - you know, "don't look, but that guy's got [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://johnmu.com/wp-content/stuff/caution200.jpg' alt="caution - bad links ahead" class="alignleft" />I support the <a href="http://microformats.org/wiki/rel-nofollow">"rel=nofollow" HTML microformat</a> as a way to mark links which might be problematic, whether they're clearly spammy, just not checked or even just sites that I don't really want to link to (but still want to provide a link for others to use - you know, "don't look, but that guy's got a <a rel="nofollow" href="http://images.google.com/images?q=big+nose">giant nose</a>!"). I understand that it is important for search engines to recognize these kinds of links and to treat them differently. This of course implies that sites use the rel=nofollow properly and do not just apply it to all outbound links (or at least to all links that do not go to their own network)...</p>
<p>That said, I believe that all users should be able to recognize these links as being problematic (or untrusted) at first glance. The more advanced, web-savvy users will sometimes have <a href="http://www.quirk.biz/searchstatus/">tools</a> installed or <a href="http://www.linktutorial.com/read/articles/detecting-relnofollow-firefox">special settings</a> which highlight links with "rel=nofollow", the normal user does not. <strong>If a link is marked as being problematic / untrusted for search engines, the user should see that as well</strong> -- it's nothing more than the <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&#038;answer=35769&#038;hola">Google Webmaster Guideline</a> "<em>Don't deceive your users or present different content to search engines than you display to users (...)</em>". It is deceiving to show users a normal link and at the same time tell search engines that you really don't want to link there! In my opinion, if the link is not good enough, the user should be informed. There are two ways to do that.<br />
<span id="more-84"></span><br />
My favorite solution would be for browsers to automatically highlight these kinds of links on all sites. However, I doubt that will happen any time soon... </p>
<p>The other solution would be for websites to highlight their own rel=nofollow'ed links. I am doing that here on this site (for the major, modern browsers at least) - an example can be found in my <a href="http://johnmu.com/policy/nofollow/">linking policy</a>. Links with the rel=nofollow microformat are <span style="border-bottom: dashed 2px #ffa500">underlined</span> and displayed with a <img src="http://johnmu.com/files/nofollow.gif" alt="nofollow symbol" /> small warning symbol. </p>
<p>Adding that to your own site is easy enough - it just requires a small change in your CSS stylesheet and uploading the symbol to your server. </p>
<ol>
<li>Download the symbol: <a href="http://johnmu.com/files/nofollow.gif" title="nofollow symbol" target="_blank"><img src="http://johnmu.com/files/nofollow.gif" alt="nofollow symbol" /></a> (right-click on it and save a local copy of it). Copy it onto your server into the folder where you have your stylesheet file (this depends on your site - on Wordpress it will be in your theme folder)</li>
<li>Open your stylesheet file and add the following lines to the end of the file:
<div class="igBar"><span id="lcss-6"><a href="#" onclick="javascript:showPlainTxt('css-6'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-6">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">a<span style="color: #66cc66;">&#91;</span>rel~=nofollow<span style="color: #66cc66;">&#93;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span>: <span style="color: #993333;">dashed</span> 2px #ffa500;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'nofollow.gif'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">center</span> <span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-left</span>: 17px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- css-6--></p>
<p>If you have placed the image in a different folder, you need to specify it here. If you with to use a different sized image, make sure you adjust the "padding-left" setting (this makes room for the symbol). If you have an orange background on your site, also make sure that you adjust the color from "#ffa500" to something that contrasts the background (in that case you might also consider changing the colors in the symbol). Upload the stylesheet to your server.</li>
<li>Done!
<p>You should see the changes when you open a new page on the site. In some cases you might have to restart your browser to see the modified stylesheet. </li>
</ol>
<p>Do you think that a global highlighting like this would make some sites take a second look at their policy of adding "rel=nofollow" to all outbound links? Imagine you had an encyclopedia where all references were highlighted as being untrusted <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . </p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/highlight-nofollow/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Adding text resizing with cookie</title>
		<link>http://johnmu.com/adding-text-resizing/</link>
		<comments>http://johnmu.com/adding-text-resizing/#comments</comments>
		<pubDate>Mon, 16 Jul 2007 11:19:40 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://johnmu.com/adding-text-resizing/</guid>
		<description><![CDATA[In the top right corner of this blog I have placed a small set of links that let you resize the text as it is displayed. It's easy to use this script on your blog and it lets your visitors resize the text on the blog however they want it. The resizing setting is stored [...]]]></description>
			<content:encoded><![CDATA[<p>In the top right corner of this blog I have placed a small set of links that let you resize the text as it is displayed. It's easy to use this script on your blog and it lets your visitors resize the text on the blog however they want it. The resizing setting is stored in a cookie, valid for one year, so when the visitor returns, they will see the site as they resized it last.<br />
<span id="more-68"></span><br />
To add the script you only have to copy one file into your theme folder and add a line of javascript into your theme in an appropriate location. It might look like a lot of steps here, but you'll see that it's fairly simple. </p>
<ol>
<li><strong>Make a backup</strong>
<p>Before you change anything, always make a backup of your theme files and perhaps even of your full Wordpress installation. It never hurts to have too many backups <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
</li>
<li><strong>Download the script</strong>
<p>Download the file <a href="http://johnmu.com/files/textresize.js" target="_blank">textresize.js</a> from here. Put it on your desktop or someplace where you can find it.
</li>
<li><strong>Check your Wordpress theme</strong>
<p>You might be able to skip this step, depending on how your Wordpress theme is made. Open your blog in your browser, use "View Source" and take a quick look at the source code (not too long, it could make your head spin). You should find a section pretty much on top which "wraps" your whole site in a "DIV" element. Often it will be called "wrapper", "content" or "container". It will look something like this:</p>
<div class="igBar"><span id="lhtml-13"><a href="#" onclick="javascript:showPlainTxt('html-13'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-13">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"wrapper"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-13--></p>
<p>If you find multiple names that you believe could be the main elements, you might want to try them separately to see which one works best. The default in the code is "wrapper".
</li>
<li><strong>Update the script to match your theme</strong>
<p>If your theme does not use "wrapper" as the ID of the main element, you will need to adjust the javascript file. Don't worry, it's not painful <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Open your copy of "textresize.js" in a text editor like Notepad. You will find the following line near the top:</p>
<div class="igBar"><span id="ljavascript-14"><a href="#" onclick="javascript:showPlainTxt('javascript-14'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-14">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> ts_styleElement=<span style="color: #3366CC;">"#wrapper"</span>; <span style="color: #009900; font-style: italic;">// the ID of the content DIV that you want to resize </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-14--></p>
<p>Change that line to match your main element, eg:</p>
<div class="igBar"><span id="ljavascript-15"><a href="#" onclick="javascript:showPlainTxt('javascript-15'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-15">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> ts_styleElement=<span style="color: #3366CC;">"#content"</span>; <span style="color: #009900; font-style: italic;">// the ID of the content DIV that you want to resize </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-15--></p>
<p>Save the file before a cat walks across your keyboard. </p>
</li>
<li><strong>Upload the script to your server</strong>
<p>Copy the modified file onto your server into the current theme folder.
</li>
<li><strong>Update your theme files</strong>
<p>Add the following to your <strong>header.php</strong> in the bottom of the "head" section:</p>
<div class="igBar"><span id="lhtml-16"><a href="#" onclick="javascript:showPlainTxt('html-16'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-16">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066;">src</span>=<span style="color: #ff0000;">"&lt;?php bloginfo('stylesheet_directory'); ?&gt;</span>/textresize.js&quot; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;type=&quot;text/javascript&quot;&gt;<span style="color: #009900;">&lt;/script&gt;</span> </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-16--></p>
<p>Now add the following wherever you wish to see the resize links:</p>
<div class="igBar"><span id="lhtml-17"><a href="#" onclick="javascript:showPlainTxt('html-17'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-17">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; showReadabilityMenu('Resize text:');</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; //--&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-17--></p>
<p>I have placed this in my <strong>header.php</strong>, right after the "searchform" include.
</li>
<li><strong>Optionally add more styling</strong>
<p>You can style the line with changes to your CSS file, eg: </p>
<div class="igBar"><span id="lcss-18"><a href="#" onclick="javascript:showPlainTxt('css-18'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-18">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#header <span style="color: #cc00cc;">#fontsizemenu </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-top</span>: 2px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- css-18--><br />
This will depend on your theme and on what you want to do to integrate the links.
</li>
<li><strong>Test, test, test </strong> <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
<p>Be sure to test the new functionality in the major browsers. I have tested the code in IE 6.5, IE 7.0, Firefox 2.0 and Opera 9.0. The code depends on javascript. With javascript turned off, the user will not see anything.
</li>
</ol>
<p>Have fun!</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/adding-text-resizing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.580 seconds -->
