<?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>Web, Design, SEO and other Hobbies &#187; Web</title>
	<atom:link href="http://www.gwdesign.net/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gwdesign.net/blog</link>
	<description>Graham Wöbcke : Sydney, Australia - Web and Design Tips plus any opinions I feel I need to express</description>
	<lastBuildDate>Fri, 16 Jul 2010 03:00:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Stop Skype Toolbar Ruining Your Page Design With</title>
		<link>http://www.gwdesign.net/blog/web/stop-skype-toolbar-ruining-your-page-design-with/</link>
		<comments>http://www.gwdesign.net/blog/web/stop-skype-toolbar-ruining-your-page-design-with/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 02:43:34 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.gwdesign.net/blog/?p=933</guid>
		<description><![CDATA[Wow. It&#8217;s been ages since I wrote a post here. I&#8217;ve been busy and I&#8217;ve dedicated more time to real work and my family. Anyway, here is a small tip I thought I would share. Even though I use Skype a lot, I am increasingly frustrated with the way the Skype browser extensions hijack your [...]]]></description>
			<content:encoded><![CDATA[<p>Wow. It&#8217;s been ages since I wrote a post here. I&#8217;ve been busy and I&#8217;ve dedicated more time to real work and my family.</p>
<p>Anyway, here is a small tip I thought I would share. Even though I use Skype a lot, I am increasingly frustrated with the way the Skype browser extensions hijack your page designs and add in click-to-call buttons.</p>
<p>A while ago Skype acknowledged a special Meta Tag to not do this, however, it seems this is ignored. So, if you want to rid your site of this, just add in a special space character between the numbers and the Skype buttons will be gone.</p>
<pre><code>
214&amp;#x2004;555&amp;#x2004;7788
</code></pre>
<p>I hope you find this tip useful. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwdesign.net/blog/web/stop-skype-toolbar-ruining-your-page-design-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More ASP Tips</title>
		<link>http://www.gwdesign.net/blog/web/more-asp-tips/</link>
		<comments>http://www.gwdesign.net/blog/web/more-asp-tips/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 02:35:29 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Classic ASP Code]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.gwdesign.net/blog/?p=490</guid>
		<description><![CDATA[Lately I have needed to perform a lot of redirects from old pages to new pages. Some of these old pages have decent rankings in search engines, so how do I make sure these new pages retain this ranking? By using a HTTP 301 Redirect (HTTP Moved Permanently). Here is how you code a 301 [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have needed to perform a lot of redirects from old pages to new pages. Some of these old pages have decent rankings in search engines, so how do I make sure these new pages retain this ranking? By using a HTTP 301 Redirect (HTTP Moved Permanently). Here is how you code a 301 redirect in ASP:</p>
<pre><code>
&lt;%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "/newer-page.asp"
%&gt;
</code></pre>
</p>
<p>
If you are wanting to redirect to your default page name (index.asp,default.asp etc.), it is a good idea to redirect only to the folder name and leave off the name of the page like:</p>
<pre><code>
&lt;%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "/subfolder/"
%&gt;
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwdesign.net/blog/web/more-asp-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More ASP String Functions</title>
		<link>http://www.gwdesign.net/blog/web/more-asp-string-functions/</link>
		<comments>http://www.gwdesign.net/blog/web/more-asp-string-functions/#comments</comments>
		<pubDate>Sat, 10 Feb 2007 12:13:07 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Classic ASP Code]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.gwdesign.net/blog/?p=439</guid>
		<description><![CDATA[Continuing my previous post with ASP string functions, here are a few more code snippets The first code snippet is a little function that strips out specified special characters. It basically seeks out any of the characters that exist in the array and removes them all. &#60;% Function StripSpecialChar(inStr) dim sOut,outStr,arrSpecialChar,intCounter arrSpecialChar = Array("%20","&#38;amp;","&#38;","#","+","@") outStr [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing my previous post with ASP string functions, here are a few more code snippets
</p>
<p>The first code snippet is a little function that strips out specified special characters. It basically seeks out any of the characters that exist in the array and removes them all. </p>
<p><pre><code>&lt;%
Function StripSpecialChar(inStr)
	dim sOut,outStr,arrSpecialChar,intCounter
	 arrSpecialChar  = Array("%20","&amp;amp;","&amp;","#","+","@")
	 outStr = inStr
	 intCounter = 0

	 Do Until intCounter = UBOUND(arrSpecialChar)+1
	  sOut = replace(outStr,arrSpecialChar(intCounter)  ,"")
	  intCounter = intCounter + 1
	  outStr = sOut
	 Loop
	 StripSpecialChar = outStr
end Function
%&gt;</code></pre>
</p>
<p>The final snippet is a simple function that will check an array for any occurances of a particular string.</p>
<p><pre><code>&lt;%
Function in_array(element, arr)
  For i=0 To Ubound(arr)
     If Trim(arr(i)) = Trim(element) Then
        in_array = True
        Exit Function
     Else
        in_array = False
     End If 
  Next
End Function

str = "Apple"
colors = Array("Banana","Apple","Orange")

If in_array(str,colors) Then Response.Write str &amp; " is in the array"
Else Response.Write str &amp; " is not in the array"
End If
%&gt;</code></pre>
</p>
<p>I hope you find these functions as useful as I do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwdesign.net/blog/web/more-asp-string-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Useful WordPress Tips With Comments</title>
		<link>http://www.gwdesign.net/blog/web/two-useful-wordpress-tips-with-comments/</link>
		<comments>http://www.gwdesign.net/blog/web/two-useful-wordpress-tips-with-comments/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 12:02:19 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.gwdesign.net/blog/?p=432</guid>
		<description><![CDATA[If you like to use WordPress, here are three tips for handling your comments in a more effective manner. I strongly recommend you use the tips in conjunction with SpamKarma2, a very effective WordPress plugin for stopping 99% of spam posts. Tip 1: Control The Order Of Your Comments By default, WordPress will display your [...]]]></description>
			<content:encoded><![CDATA[<p>If you like to use WordPress, here are three tips for handling your comments in a more effective manner. I strongly recommend you use the tips in conjunction with SpamKarma2, a very effective WordPress plugin for stopping 99% of spam posts.</p>
<p>
<strong>Tip 1: Control The Order Of Your Comments</strong>
</p>
<p>
By default, WordPress will display your comments in ascending date order. However, if you would like your comments to appear with the most recent first, you will need to make a small but easy change to your theme&#8217;s comments.php file. Here is how to do it:</p>
<ol>
<li>Connect to your webserver and inside the theme&#8217;s folder, search for the file named comments.php and open/edit it</li>
<li>Find this line:
<pre><code>&lt;?php foreach ($comments as $comment) : ?&gt;</code></pre>
</li>
<li>Above that line, add this code:
<pre><code>&lt;?php $comments = array_reverse($comments, true); ?&gt;</code></pre>
</li>
</ol>
<p>
Now your comments will be in descending date order. To revert back to ascending date order, either remove or comment this new line of code.
</p>
<p>
<strong>Tip 2: Prefix Your Comment With A Comment Order Number</strong>
</p>
<p>
Some people like to prefix the comments shown with a comment number. Some themes do this automatically, but if you would like to add this feature to a theme, here are the steps required to do this:</p>
<ol>
<li>Connect to your webserver and inside the theme&#8217;s folder, search for the file named comments.php and open/edit it</li>
<li>Find this line:
<pre><code>&lt;ol class="commentlist"&gt;</code></pre>
</li>
<li>Above that line, add this code:
<pre><code>&lt;?php $count = count($comments); ?&gt;</code></pre>
</li>
<li>Now find this line:
<pre><code>&lt;?php endforeach; /* end for each comment */ ?&gt;</code></pre>
</li>
<li>Above that line, add this code:
<pre><code>&lt;?php $count--; ?&gt;</code></pre>
</li>
<li>Finally, find this line:
<pre><code>&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:</code></pre>
</li>
<li>Above that line, add this code:
<pre><code>&lt;?php echo $count; ?&gt;)</code></pre>
</li>
</ol>
<p>Now your comments will be prefixed with a number and a bracket eg. 9) &#8212; you can change the ) to any character you like or remove it all together, it&#8217;s your choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwdesign.net/blog/web/two-useful-wordpress-tips-with-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrape External Site Content With ASP</title>
		<link>http://www.gwdesign.net/blog/web/scrape-external-site-content-with-asp/</link>
		<comments>http://www.gwdesign.net/blog/web/scrape-external-site-content-with-asp/#comments</comments>
		<pubDate>Wed, 31 May 2006 13:12:53 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Classic ASP Code]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.gwdesign.net/blog/?p=209</guid>
		<description><![CDATA[There are many times were you have wanted to grab something from another site that isn&#8217;t provided via RSS. You could type it in, but that would be time consuming. So how do we do this? We scrap the content from the site using the XMLHTTP object. If you have read the previous article on [...]]]></description>
			<content:encoded><![CDATA[<p>There are many times were you have wanted to grab something from another site that isn&#8217;t provided via RSS. You could type it in, but that would be time consuming. So how do we do this? We scrap the content from the site using the XMLHTTP object. If you have read the previous article on how to cache an RSS feed, you will no doubt say many similarities here in this article, so I won&#8217;t re-explain those portions. So let&#8217;s have a look at the code.
</p>
<p>
<pre><code>&lt;%
FUNCTION LoadThePage(strPageText, strInputURL)
	Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
	objXMLHTTP.Open "GET", strInputURL, False
	objXMLHTTP.Send
	strPageText = objXMLHTTP.responseText
	Set objXMLHTTP = Nothing
End FUNCTION

FUNCTION GrabTheContent(strStart, strEnd)
	Dim strStartPos, strEndPos, strLength
	strStartPos = 0
	strEndPos = 0
	strLength = 0
	'Find the Start Position of the Search String
	strStartPos = instr(strPageText,strStart)
	'Starting from the Search String start position and call it the end position
	strEndPos = instr(strStartPos, strPageText, strEnd)
	'Compute the length of the string in between the start and end positions
	strLength = strEndPos - strStartPos
	'filter the content, use trim to eliminate leading and trailing spaces
	myContent = trim(mid(strPageText,strStartPos, len(strStart))) &amp; "&lt;br/&gt;" &amp; vbCRLF
	myContent = myContent &amp; trim(mid(strPageText,strStartPos + len(strStart), StrLength - len(strStart))) &amp; "&lt;br/&gt;" &amp; vbCRLF
	GrabTheContent = myContent
End FUNCTION

'Declare the string used to hold the HTTP and the start/end strings
Dim strPageText, strStart, strEnd
'Declare and initialize the string used to hold the Input Page URL
Dim strInputURL

if DateDiff("h", Application("updated"), Now()) &gt;=1 then
	strInputURL = "http://www.austmus.gov.au/factSheets/galah.htm"
	'Load the desired page into a string
	LoadThePage strPageText, strInputURL
	strHTML = GrabTheContent("Cacatua roseicapilla","Food and feeding")
	Application.Lock
		Application("content") = strHTML
		Application("updated") = Now()
	Application.Unlock
end if

strHTML = Application("content")
response.write (strHTML)
%&gt;</code></pre>
</p>
<p>
The code contains two functions, LoadThePage and GrabTheContent, and there names self explain what they perform. LoadThePage saves a copy the external HTML into an XMLHTTP object. GrabTheContent manipulates this object and returns a string that we can use. We give this function two paramters, the text at the start of the section we want to grab and the text that ends what we want to grab. Pretty simple. For this example, we will be using <a href="http://www.austmus.gov.au/factSheets/galah.htm" target="_blank">http://www.austmus.gov.au/factSheets/galah.htm</a> as the page we retrieve text from.
</p>
<p>
Now the main portion of the program firstly it checks the date stamp of the application variable from when it was last cached and if necessary, retrieves a new cache. We do this so we don&#8217;t hammer someone else&#8217;s website and slow down the performance of our page (and to not annoy the other webserver with heaps of connections). Once we have either retrieved a new cache or used the existing one, we display the contents on the page. So we would see these results:
</p>
<p><iframe scrolling="no" frameborder="0" style="border: 0px none ; margin: 0px; padding: 0px; width: 500px; height: 420px" src="http://www.gwdesign.net/blog/wp-content/uploads/2006/05/galah1.htm"></iframe></p>
<p>Ok. So that is nice but how would we format this retrieved text? How do you remove the HTML tags?</p>
<p>To strip the HTML tags, we will be using a function I have previously published named stripHTML. What this function does is strip ALL HTML tags using regex and returns plain text. Now to format the text appearance, we will  need to use the string REPLACE function to change/remove/insert tags into appropriate places. Essentially, you scan through the retrieved page and add in the formatting you like. We will finally present this text inside a DIV with an inline style applied. So we would firstly add in the stripHTML function:</p>
<p><pre><code>&lt;%
FUNCTION stripHTML(strHTML)
  Dim objRegExp, strOutput, tempStr
  Set objRegExp = New Regexp
  objRegExp.IgnoreCase = True
  objRegExp.Global = True
  objRegExp.Pattern = "&lt;(.|n)+?&gt;"
  'Replace all HTML tag matches with the empty string
  strOutput = objRegExp.Replace(strHTML, "")
  'Replace all &lt; and &gt; with &amp;lt; and &amp;gt;
  strOutput = Replace(strOutput, "&lt;", "&amp;lt;")
  strOutput = Replace(strOutput, "&gt;", "&amp;gt;")
  stripHTML = strOutput    'Return the value of strOutput
  Set objRegExp = Nothing
END FUNCTION
&gt;%</code></pre>
</p>
<p>And finally, we would change how the text is presented at the bottom of the script to this:</p>
<p><pre><code>&lt;%
strHTML = Application("content")
strHTML = stripHTML(strHTML)
strHTML = REPLACE(strHTML,"Cacatua roseicapilla","&lt;B&gt;Cacatua Roseicapilla&lt;/B&gt;&lt;br/&gt;&lt;br/&gt;")
strHTML = REPLACE(strHTML,"Description","&lt;b style='font:bold 12px/15px Arial,Helvetica;color:#cc0000;'&gt;Description&lt;/b&gt;&lt;br/&gt;")
strHTML = REPLACE(strHTML,"Distribution and Habitat ","&lt;br/&gt;&lt;br/&gt;&lt;b style='font:bold 12px/15px Arial, Helvetica;color:#cc0000;'&gt;Distribution and Habitat &lt;/b&gt;&lt;br/&gt;")
response.write "&lt;DIV style='width:250px;font:normal 12px/15px Arial,Helvetica;color:#333333;text-align:justify;'&gt;" &amp; strHTML &amp; "&lt;/div&gt;"
%&gt;</code></pre>
</p>
<p>So let&#8217;s take a look at how it appears now:</p>
<p><iframe scrolling="no" frameborder="0" style="border: 0px none ; margin: 0px; padding: 0px; width: 500px; height: 400px" src="http://www.gwdesign.net/blog/wp-content/uploads/2006/05/galah2.htm"></iframe></p>
<p>There you go, much better. Exactly the same results as the first example but much more readable and adaptable to your site after using your formatting. Hopefully you find this useful one day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwdesign.net/blog/web/scrape-external-site-content-with-asp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
