<?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>JiveBay &#187; Web</title>
	<atom:link href="http://jivebay.com/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://jivebay.com</link>
	<description>Web Development, Code Snippets, Technology, Reviews and Random Stuff Blog</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:39:11 +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>Alternatives to Digg</title>
		<link>http://jivebay.com/2010/07/29/alternatives-to-digg/</link>
		<comments>http://jivebay.com/2010/07/29/alternatives-to-digg/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 13:39:11 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[digg]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=737</guid>
		<description><![CDATA[Find alternative sites that are like Digg, because you might not like Digg version 4 and besides Digg is no longer just about technology news.]]></description>
			<content:encoded><![CDATA[<p>Just incase you don&#8217;t like the Digg version 4, here are some alternatives to check out.</p>
<ul>
<li><a href="http://www.dzone.com/">DZone</a> &#8211; Great site for development news and blog stories, they have plenty of tags to let you filter out what you use. The site gets a lot of submissions but not enough votes on the submissions to figure out what is really good (the top stories for 24 hours may only have 15 or 8 votes). Also the AJAX scrollbar is irritating to me.</li>
<li><a href="http://www.designfloat.com/">DesignFloat</a> &#8211; Focuses on web design news and tips, but most of the submissions are nothing but lists.</li>
<li><a href="http://designbump.com/">DesignBump</a> &#8211; Another site about web design news and lots of lists</li>
<li><a href="http://sphinn.com/">Sphinn</a> &#8211; Dedicated to internet marketing</li>
<li><a href="http://www.reddit.com/">reddit</a> &#8211; Similar to Digg, but the design is too plain and submitting stories can be a pain as they make you wait a long time before submitting again. The submissions are pretty general so expect a lot of weird images, funny videos and bizarre news.</li>
<li><a href="http://slashdot.org/">Slashdot</a> &#8211; The classic technology news site is still around and has improved a bit, but it doesn&#8217;t have as that much information on web development and design.</li>
<li><a href="http://www.mixx.com/front_page">Mixx (classic)</a> &#8211; The submitted stories aren&#8217;t as good as they should be, but you&#8217;ll get the top news stories. The site has a general audience, so the technology news isn&#8217;t what it could be. I really dislike how they changed the homepage for mixx.com because they wanted to promote tweetmixx which doesn&#8217;t seem much more than something that could be a sidebar.</li>
<li><a href="http://www.propeller.com/">Propeller</a> &#8211; Another general news site.</li>
<li><a href="http://buzz.yahoo.com/">Yahoo! Buzz</a> &#8211; Another site to find the top news stories online</li>
</ul>
<img src="http://jivebay.com/?ak_action=api_record_view&id=737&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/07/29/alternatives-to-digg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Yahoo! Messenger Security Hole</title>
		<link>http://jivebay.com/2010/07/03/a-yahoo-messenger-security-hole/</link>
		<comments>http://jivebay.com/2010/07/03/a-yahoo-messenger-security-hole/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 13:58:18 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=728</guid>
		<description><![CDATA[Yahoo! Messenger allows anyone to send files to another person, even those that are not on your buddy list. Sometimes people will use this feature over and over to crash or lock up your Yahoo! Messenger client.]]></description>
			<content:encoded><![CDATA[<p>Why does <a href="http://messenger.yahoo.com/">Yahoo! Messenger</a> allow people that are not on your buddy list to send you files? Seriously, there should be an option to disable anyone sending you a file that is not on your buddy list. If you want to trust anyone, you can disable that option, otherwise you should be able to turn it on and prevent anyone from giving  you viruses. Not only that, but I&#8217;ve noticed that somehow people that send you files over and over can crash your Yahoo! Messenger or lock it up so you have to Control-Alt-Delete and kill the program.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=728&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/07/03/a-yahoo-messenger-security-hole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahoo! Messenger is the Worst on Spam</title>
		<link>http://jivebay.com/2010/06/25/yahoo-messenger-is-the-worst-on-spam/</link>
		<comments>http://jivebay.com/2010/06/25/yahoo-messenger-is-the-worst-on-spam/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 12:30:38 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=722</guid>
		<description><![CDATA[Yahoo! Messenger is full of spam bots. You cannot block or ignore conference invitations either only chat invites.]]></description>
			<content:encoded><![CDATA[<p>This should go without saying, because I&#8217;m sure if you have used <a href="http://messenger.yahoo.com/">Yahoo! Messenger</a> you know its a place for spam bots.</p>
<p>One thing that bothers me is that I often get conference invites.<br />
<a href="http://jivebay.com/wp-content/uploads/yahoo_messenger_conference_invitation.png"><img src="http://jivebay.com/wp-content/uploads/yahoo_messenger_conference_invitation.png" alt="" title="yahoo_messenger_conference_invitation" width="367" height="216" class="alignnone size-full wp-image-724" /></a></p>
<p>However, there is no setting to disable or ignore those. You can only ignore chat invitations.<br />
<a href="http://jivebay.com/wp-content/uploads/yahoo_messenger_chat_preferences.png"><img src="http://jivebay.com/wp-content/uploads/yahoo_messenger_chat_preferences-450x433.png" alt="" title="yahoo_messenger_chat_preferences" width="450" height="433" class="alignnone size-medium wp-image-723" /></a></p>
<p>Seriously they need to add this option, I get these all the time. Yes, I could use <a href="http://pidgin.im/">Pidgin</a>, but Pidgin doesn&#8217;t have all the features that Yahoo! Messenger has.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=722&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/06/25/yahoo-messenger-is-the-worst-on-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Features Digg Killed</title>
		<link>http://jivebay.com/2010/05/28/features-digg-killed/</link>
		<comments>http://jivebay.com/2010/05/28/features-digg-killed/#comments</comments>
		<pubDate>Fri, 28 May 2010 17:27:21 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[digg]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=694</guid>
		<description><![CDATA[Features that Kevin Rose's Digg has removed over the years. Notable killed features are Shouts, DiggBar, the Top Users and more.]]></description>
			<content:encoded><![CDATA[<p>I started using <a href="http://digg.com/">Digg</a> back in 2005 and I remember a lot of features they had and have abandoned. I thought I would share as many as I can remember and why I think they were removed.</p>
<p><strong>Top Users</strong><br />
This was a list of the top users, which listed the a user&#8217;s username, how many stories they had got on the homepage, how many submissions they had made, the ratio of homepage stories to submissions, how many stories they dugg, how many comments they had made, and how many pageviews their profile had recieved. Later on it was broken into 2 tabs one for Top Diggers and the other for Top Submitters. This was a great feature in the beginning as it featured those who helped make digg what it was. However, as the Digg algorithm became more important it let to the conclusion that the top users (power users or submitters) were the ones that had an unfair advantage of what made the frontpage. </p>
<p><strong>Digg Spy</strong> (the original non-flash version)<br />
I always like the non-flash version of Digg Spy, it was a great way of seeing what was becoming popular or unpopular (you could see buries). I showed this to people when I needed to give them an idea of what AJAX was and let them know that this was pretty much real time data. It was taken down since they had built <a href="http://labs.digg.com/bigspy/">another version of it in Flash</a>.</p>
<p><strong>Digg Shout</strong><br />
A messaging system for users to contact each other through Digg to help get friends or other users to promote stories they submitted or for messages in general. However, it ended up becoming mostly a spammy system where people tried to get everyone to promote their own stories. However you could disable this feature or only allow friends to shout to you. It was replaced by email, <a href="http://twitter.com/">Twitter</a> and <a href="http://www.facebook.com/">Facebook</a> sharing links.</p>
<p><strong>DiggBar</strong><br />
I believe this was introduced to help stickiness (to keep traffic on Digg as much as possible) since it gave a shortened URL for all links and put the site linked to below in an IFRAME. It also featured a <strong>random</strong> button that would send you to another story, which many believed was a way to compete with <a href="http://www.stumbleupon.com/">StumbleUpon</a>. Originally you could also type digg.com/ before the URL of any page you&#8217;re on to create a short URL. As of writing, this feature hasn&#8217;t been removed, but <a href="http://kevinrose.com/">Kevin Rose</a> has <a href="http://about.digg.com/blog/digg-digg-iframe-toolbar-dead-unbanning-domains">stated it is going away</a>.</p>
<p><strong>Blog This</strong><br />
A feature that let you blog about a story that you or someone else submitted. Was considered no longer needed once they added the email, Twitter and Facebook sharing links.</p>
<p><strong>Digg Clouds</strong><br />
This was basically a tag cloud, but for stories submitted to Digg. This was replaced by the Upcoming section.</p>
<p><strong>Digg Comments with a Slashdot style rating system</strong><br />
Many may not know that the comment rating system Digg used in the early days, was very similar to Slashdot. They used to let you rate a comment as +3 Excellent, +2 Insightful, +1 Useful, 0 Neutral, -1 Redundant, -2 Flame, -3 SPAM. Eventually they went to the simple, thumbs up or thumbs down.</p>
<p><strong>Comments replies via email that sent you the reply</strong><br />
Digg finally realized they should email you replies to your comments (I always wondered why they didn&#8217;t do this earlier). However, I believe they decided to remove the actualy reply to your comment for 2 reasons. One being that it was susceptible to spam, but I think the biggest reason was to get more pageviews by making you want to see what someone said and you had to visit the link they sent you to do that.</p>
<p><strong>Categories Digg has removed</strong></p>
<ul>
<li><strong>Deals</strong> &#8211; This was for finding great tech deals online. However, it wasn&#8217;t used very much, but then again, there probably aren&#8217;t that many good deals out there on a regular basis.</li>
<li><strong>Robots</strong> &#8211; A section for robotics, but wasn&#8217;t used all that much so it went away.</li>
<li><strong>Election 2008</strong> &#8211; Makes sense since they only needed it for that time period.</li>
</ul>
<p>Like any good website Digg has evolved and continues to try new things to see what works and what doesn&#8217;t. I still wish they had remained true to their technology niche, but at least I can filter out the categories I don&#8217;t like and disable image and video submissions.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=694&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/05/28/features-digg-killed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of Reserved Login or Bad Usernames</title>
		<link>http://jivebay.com/2010/05/18/list-of-reserved-login-or-bad-usernames/</link>
		<comments>http://jivebay.com/2010/05/18/list-of-reserved-login-or-bad-usernames/#comments</comments>
		<pubDate>Tue, 18 May 2010 15:26:54 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=686</guid>
		<description><![CDATA[A starting list of reserved login names, bad usernames, insecure login names and user names people shouldn't register or sign up with.]]></description>
			<content:encoded><![CDATA[<p>The following are names you might want to prevent form being used not only by users, but also anyone that uses the admin to your site.</p>
<blockquote><p>about, aboutus, admin, administer, administor, administrater, administrator, anonymous, auther, author, blogger, contact, contactus, contributer, contributor, cpanel, delete, directer, director, editer, editor, email, emailus, guest, info, loggedin, loggedout, login, logout, moderater, moderator, mysql, nobody, operater, operator, oracle, owner, postmaster, president, registar, register, registrar, root, signout, test, user, vicepresident, webmaster</p></blockquote>
<p>A few of them are misspelled, typos, common login names, names hackers usually try to use to break in, and other names that regular users probably shouldn&#8217;t use as they would pretend to be someone they are not. Of course you may want to add the ability to prevent any starting with or ending with <strong>admin</strong> or <strong>moderator</strong>.</p>
<p>This is a good list to start with, share any others if you like. I didn&#8217;t include any cusswords, but it&#8217;s a good idea to add those into another table and make sure people don&#8217;t use those for usernames or just for part of it. Also this list took into consideration that the shortest username would be 4 characters long and only allowed letters and numbers.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=686&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/05/18/list-of-reserved-login-or-bad-usernames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trim Login Fields</title>
		<link>http://jivebay.com/2010/04/22/trim-login-fields/</link>
		<comments>http://jivebay.com/2010/04/22/trim-login-fields/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 14:19:06 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=470</guid>
		<description><![CDATA[Why web forms should trim the username and password fields on login forms.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen lots of login fields that don&#8217;t trim the input forms when they test to see if it matches what&#8217;s in their database. However, they forget that many people simply copy and paste this information from an email they receive. Depending on how you copy the text from your email, sometimes you will get a linebreak or extra space at the end. Since the password fields are all starred out, you wont even notice the extra space or character at the end and fail to login. I&#8217;ve seen other people do this and a few times I&#8217;ve had it to me. Because often a site will give you a random password, so it&#8217;s easier just to copy and paste it into the login. Trim the username and password fields for the login only, I don&#8217;t see any need to do it for registration forms.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=470&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/04/22/trim-login-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Newspaper Websites Wake Up</title>
		<link>http://jivebay.com/2010/04/18/newspaper-websites-wake-up/</link>
		<comments>http://jivebay.com/2010/04/18/newspaper-websites-wake-up/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 15:43:41 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[local]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=377</guid>
		<description><![CDATA[Newspaper websites are hurting and Local Television stations are starting to wake up to the web. The hyperlocal battle for online news and information is heating up. Here is what the newspapers need to do to survive.]]></description>
			<content:encoded><![CDATA[<p>With the competition between Local TV stations and Newspapers heating up, newspapers need to wake up fast.</p>
<p>Pick 1 JavaScript library and stick with it. Some JavaScript libraries don&#8217;t play nicely with others, plus it adds to load time.</p>
<p><strong>Weather</strong><br />
Put this on your front page! There is a reason why Mac OS X&#8217;s Dashboard widgets, <a href="http://widgets.yahoo.com/">Yahoo&#8217;s Widgets</a> (formerly known as Konfabulator), Vista&#8217;s Gadgets, <a href="http://igoogle.com/">iGoogle</a>, <a href="http://pageflakes.com/">Pageflakes</a> all have weather as their most popular module. Weather is very important. I would recommend current conditions, today&#8217;s forecast and tomorrow&#8217;s at the very minimum. You can then point them to your weather page that has more information on it.</p>
<p>Stop paying <a href="http://www.accuweather.com/">Accuweather</a> and <a href="http://www.weather.com/">Weather.com</a> for weather information. I&#8217;ve made several posts on this blog, about how to pull from the free weather data from the National Weather Service with code samples. Most of the data Accuweather and Weather.com get is from the <a href="http://www.weather.gov/">NWS</a> anyway, they just package it up, make it look pretty and give you easy ways to deal with it. With a little time and patience you can pull that data for free and mash it up how you like. Besides, Accuweather has some of the worst customer service there is and that is a well known fact. The amount of time you wasted for them to respond back for something you paid for or for answering a question, you could of used to built it in-house.</p>
<p>Local TV stations often have more accurate weather information than Accuweather or Weather.com, because they have their own local radar; Thus, they can set it up so it updates online by the minute. The only real reason people even bother going to local TV stations is to check the weather.</p>
<p><strong>AP News</strong><br />
<a href="http://www.ap.org/">AP</a> allows papers to get more page views (and therefore more advertising) for state, national and world news stories. Is it time to replace this method with mashups? Granted you won&#8217;t get the full story on your site, but you would get headlines and or a snippet and could put a citation of source. Perhaps this could be the new newswire and get the latest headlines off the social web and then research the stories more for in depth coverage. However, newspapers have a bad habit of not posting the stories or waiting a day until they are done with them, so they have fresh news tomorrow. Stop, put that news out now and have someone come in at 5:00 in the morning to make sure there is fresh and updated news before the morning traffic hits.</p>
<p><strong>Vendor Apps</strong><br />
Stop paying for web apps from other companies. Did you know there is a market for web apps to be built for newspaper verticals (autos, classifieds, jobs, homes, obituaries, etc.) and sold directly to newspapers? The market exists because they know the newspapers don&#8217;t want to built their own app from scratch. If your company owns several newspapers why not have each site tackle one app and share it across all sites? Then you can manage upgrades, add new features and fix bugs without paying more fees and yearly costs when you already have developers.</p>
<p>Niche sites, many times a story will require extra data or some kind of flash interface to make it more appealing, I would forgo these and get the other stuff done first. Throwing up a niche site just to sell to advertisers isn&#8217;t useful unless you take into account that you should built sites to be used first and take into consideration making a site useful with data people might want. Web sites aren&#8217;t just for placing ads all over.</p>
<p>Does your city really need a separate forum app for every niche you have? Consolidate them into one. Same thing with your other sites if possible, consolidate them, with 1 look or feel.</p>
<p>Standards &#8211; Yes you know about web standards. But do you know about ad standards? How about setting new standards? How about a standard for how big your homepage can get? A 2mb homepage is unacceptable. Start setting up design standards, just because you released a new site or niche product doesn&#8217;t mean it has to get dumped on the homepage as a new block. Take the time to discuss what is most reasonable.</p>
<p>That new Flash 10 video player that takes 20 seconds to load up is unacceptable. </p>
<p>Stop trying to dump everything on the homepage. People can find things, by clicking on links. You don&#8217;t need a subnav, when each page has 150+ links. The reason no one can find anything is because there are more than 150 links on every page, adding more is not going to help. Small sites can get away with a subnav, newspaper sites cant. Trying to throw all your data at the top of the page isn&#8217;t helpful either. If you really need to promote something, make a block or area to do so. Use some JavaScript, randomize all the other features you have, use tabs if you have to.</p>
<p>Get rid of duplicate links. Small sites might be able to get away with duplicate links on the side or in the footer, but on a huge site, you need to just get rid of them. This isn&#8217;t 1995 anymore people know how to click on things and find their way around. There is nothing wrong with someone clicking on a link or two and visiting 2 or 3 pages to find what they want. In fact, that is how the web works, otherwise you might as well just have 1 page for your entire site.</p>
<p>Search &#8211; offer this and allow people to narrow down the search by photos, stories, cars and so on. You don&#8217;t have to explain how to use a search engine, this isn&#8217;t 1996, people have used Yahoo and Google before. Have only 1 search box, not 5. If you can get rid of <a href="http://www.newsbank.com/">NewsBank</a>, you should own your own stories and data and be able to provide them to your users for free also. One of the downsides to using 8 different apps for verticals and every other niche site you have is that each one has to do a separate search. What if someone wants to search for every instance of something in photos, news, obits all at once?</p>
<p>How about some white space? Stop trying to fill every gap and hole with another ad or to promote another niche site. Use some JavaScript and randomize that data, then you don&#8217;t even have to use a advertising spot to promote your ad, which is probably costing you money to serve house ads in the first place.</p>
<p>Start using so many domain names, I&#8217;ve brought this up several times on my blog, but I cannot stress this enough. dallasmorningnewsjobs.com is a waste of money, use a subdomain. Sure $10 a year may not be much but you know very well your paper probably owns about 300+ domains. While some of your domains maybe to protect your brand or market, by grabbing up dallasjobs.com or dallascars.com, be really smart in what you pick and sell the crap. And do you really need much more than the .net or .org for your main site? .biz and .info are very rarely used by good sites (css3.info is probably the only exception on the entire internet).</p>
<p>We live in a age of APIs and mashups, so start using them if you aren&#8217;t already.</p>
<p>TV stations are awake and starting to realize they need to get their online presence stronger than it has been. When it comes to weather, breaking news, video and having local news featured, their sites excel. However for in depth stories and a decent site they fail. Too often they don&#8217;t even archive their news, which is silly because people might want to look up old stories. Newspapers realized the web was their only saving grace years ago, but they locked down their content, bogged down the site with too many ads and made navigating their behemoths almost impossible.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=377&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/04/18/newspaper-websites-wake-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating the Moon Phase Part 2</title>
		<link>http://jivebay.com/2010/01/04/calculating-the-moon-phase-part-2/</link>
		<comments>http://jivebay.com/2010/01/04/calculating-the-moon-phase-part-2/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 21:54:52 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=627</guid>
		<description><![CDATA[Here is some PHP code to calculating the Lunar Phase of the Moon. It also tells the ecliptic latitude and longitude in degrees, the moon's distance in Earth radii, the moon's age in days from new moon and zodiac.]]></description>
			<content:encoded><![CDATA[<p>In an <a href="http://jivebay.com/2008/09/07/calculating-the-moon-phase/">older post about Calculating the Moon Phase</a>, I converted the some code I found to PHP. However the <a href="http://home.att.net/%7Esrschmitt/script_moon_phase.html">Lunar Phase Calculator</a> has some more information (ecliptic latitude and longitude in degrees, the moon&#8217;s distance in Earth radii, etc.), the other one doesn&#8217;t, so I went ahead and converted it from JavaScript to PHP.<br />
<span id="more-627"></span><br />
<code><br />
&lt;?php<br />
/*<br />
Based on the JavaScript<br />
Lunar Phase Calculator<br />
by Stephen R. Schmitt</p>
<p>http://home.att.net/~srschmitt/script_moon_phase.html</p>
<p>which was adapted from a BASIC program from the Astronomical Computing column of Sky &amp; Telescope, April 1994<br />
*/<br />
function isdayofmonth($month, $day, $year)<br />
{<br />
    $dim = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);<br />
    if ($month != 2)<br />
    {<br />
        if (1 &lt;= $day &amp;&amp; $day &lt;= $dim[$month - 1])<br />
            return true;<br />
        else<br />
            return false;<br />
    }<br />
    $feb = $dim[1];<br />
    if (isleapyear($year))<br />
    {<br />
        $feb++;// is leap year<br />
    }<br />
    if (1 &lt;= $day &amp;&amp; $day &lt;= $feb)<br />
    {<br />
        return true;<br />
    }<br />
    return false;<br />
}<br />
function isleapyear($year)<br />
{<br />
    $a = floor($year - 4 * floor($year / 4));<br />
    $b = floor($year - 100 * floor($year / 100));<br />
    $c = floor($year - 400 * floor($year / 400));<br />
    // possible leap year<br />
    if ($a == 0)<br />
    {<br />
        if ($b == 0 &amp;&amp; $c != 0)<br />
            return false;// not leap year<br />
        else<br />
            return true;// is leap year<br />
    }<br />
    return false;<br />
}<br />
// compute moon position and phase<br />
function moon_posit($month = null, $day = null, $year = null)<br />
{<br />
    $moon = array();<br />
    if(!isdayofmonth($month, $day, $year))<br />
    {<br />
        $moon[&#039;errors&#039;] = &#039;Invalid date&#039;;<br />
    }<br />
    else<br />
    {<br />
        $moon[&#039;errors&#039;] = null;<br />
        $age = 0.0;// Moon&#039;s age in days from New Moon<br />
        $distance = 0.0;// Moon&#039;s distance in Earth radii<br />
        $latitude = 0.0;// Moon&#039;s ecliptic latitude in degrees<br />
        $longitude = 0.0;// Moon&#039;s ecliptic longitude in degrees<br />
        $phase = &#039;&#039;;<br />
        $zodiac = &#039;&#039;;<br />
        $YY = 0;<br />
        $MM = 0;<br />
        $K1 = 0;<br />
        $K2 = 0;<br />
        $K3 = 0;<br />
        $JD = 0;<br />
        $IP = 0.0;<br />
        $DP = 0.0;<br />
        $NP = 0.0;<br />
        $RP = 0.0;<br />
        // calculate the Julian date at 12h UT<br />
        $YY = $year - floor((12 - $month) / 10);<br />
        $MM = $month + 9;<br />
        if ($MM &gt;= 12)<br />
        {<br />
            $MM = $MM - 12;<br />
        }<br />
        $K1 = floor(365.25 * ($YY + 4712));<br />
        $K2 = floor(30.6 * $MM + 0.5);<br />
        $K3 = floor(floor(($YY / 100) + 49) * 0.75) - 38;<br />
        $JD = $K1 + $K2 + $day + 59;// for dates in Julian calendar<br />
        if ($JD &gt; 2299160)<br />
        {<br />
            $JD = $JD - $K3;// for Gregorian calendar<br />
        }<br />
        // calculate moon&#039;s age in days<br />
        $IP = normalize(($JD - 2451550.1) / 29.530588853);<br />
        $age = $IP * 29.53;<br />
        if ($age &lt;  1.84566)<br />
            $phase = &#039;NEW&#039;;<br />
        else if ($age &lt;  5.53699)<br />
            $phase = &#039;Evening crescent&#039;;<br />
        else if ($age &lt;  9.22831)<br />
            $phase = &#039;First quarter&#039;;<br />
        else if ($age &lt; 12.91963)<br />
            $phase = &#039;Waxing gibbous&#039;;<br />
        else if ($age &lt; 16.61096)<br />
            $phase = &#039;FULL&#039;;<br />
        else if ($age &lt; 20.30228)<br />
            $phase = &#039;Waning gibbous&#039;;<br />
        else if ($age &lt; 23.99361)<br />
            $phase = &#039;Last quarter&#039;;<br />
        else if ($age &lt; 27.68493)<br />
            $phase = &#039;Morning crescent&#039;;<br />
        else<br />
            $phase = &#039;NEW&#039;;<br />
        $IP = $IP * 2 * pi();// Convert phase to radians<br />
        // calculate moon&#039;s distance<br />
        $DP = 2 * pi() * normalize(($JD - 2451562.2) / 27.55454988);<br />
        $distance = 60.4 - 3.3 * cos($DP) - 0.6 * cos(2 * $IP - $DP) - 0.5 * cos(2 * $IP);<br />
        // calculate moon&#039;s ecliptic latitude<br />
        $NP = 2 * pi() * normalize(($JD - 2451565.2) / 27.212220817);<br />
        $latitude = 5.1 * sin($NP);<br />
        // calculate moon&#039;s ecliptic longitude<br />
        $RP = normalize(($JD - 2451555.8) / 27.321582241);<br />
        $longitude = 360 * $RP + 6.3 * sin($DP) + 1.3 * sin(2 * $IP - $DP) + 0.7 * sin(2 * $IP);<br />
        if ($longitude &lt;  33.18)<br />
            $zodiac = &#039;Pisces&#039;;<br />
        else if ($longitude &lt;  51.16)<br />
            $zodiac = &#039;Aries&#039;;<br />
        else if ($longitude &lt;  93.44)<br />
            $zodiac = &#039;Taurus&#039;;<br />
        else if ($longitude &lt; 119.48)<br />
            $zodiac = &#039;Gemini&#039;;<br />
        else if ($longitude &lt; 135.30)<br />
            $zodiac = &#039;Cancer&#039;;<br />
        else if ($longitude &lt; 173.34)<br />
            $zodiac = &#039;Leo&#039;;<br />
        else if ($longitude &lt; 224.17)<br />
            $zodiac = &#039;Virgo&#039;;<br />
        else if ($longitude &lt; 242.57)<br />
            $zodiac = &#039;Libra&#039;;<br />
        else if ($longitude &lt; 271.26)<br />
            $zodiac = &#039;Scorpio&#039;;<br />
        else if ($longitude &lt; 302.49)<br />
            $zodiac = &#039;Sagittarius&#039;;<br />
        else if ($longitude &lt; 311.72)<br />
            $zodiac = &#039;Capricorn&#039;;<br />
        else if ($longitude &lt; 348.58)<br />
            $zodiac = &#039;Aquarius&#039;;<br />
        else<br />
            $zodiac = &#039;Pisces&#039;;<br />
        // so longitude is not greater than 360!<br />
        if ($longitude &gt; 360)<br />
            $longitude = $longitude - 360;<br />
        $moon[&#039;age&#039;] = round($age, 2);<br />
        $moon[&#039;distance&#039;] = round($distance, 2);<br />
        $moon[&#039;latitude&#039;] = round($latitude, 2);<br />
        $moon[&#039;longitude&#039;] = round($longitude, 2);<br />
        $moon[&#039;phase&#039;] = $phase;<br />
        $moon[&#039;zodiac&#039;] = $zodiac;<br />
    }<br />
    return $moon;<br />
}<br />
// normalize values to range 0...1<br />
function normalize($v)<br />
{<br />
    $v = $v - floor($v);<br />
    if ($v &lt; 0)<br />
    {<br />
        $v++;<br />
    }<br />
    return $v;<br />
}<br />
?&gt;<br />
</code></p>
<p>And to use it, you can do something like this<br />
<code><br />
&lt;?php<br />
include(&#039;moon2.php&#039;);<br />
$date = time();<br />
$year = date(&#039;Y&#039;, $date);<br />
$month = date(&#039;n&#039;, $date);<br />
$day = date(&#039;j&#039;, $date);<br />
$moon = moon_posit($month, $day, $year);<br />
//debug results<br />
echo &#039;&lt;pre&gt;&#039;;<br />
print_r($moon);<br />
echo &#039;&lt;/pre&gt;&#039;;<br />
if ($moon[&#039;errors&#039;] === null)<br />
{<br />
    //output and format what you want<br />
}<br />
else<br />
{<br />
    //handle error how you want, perhaps give error message and then show today&#039;&#039;s moon info<br />
}<br />
?&gt;<br />
</code></p>
<p>I haven&#8217;t figured out how to get the percentage of illumination of the moon though.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=627&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2010/01/04/calculating-the-moon-phase-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RSS Cron Job</title>
		<link>http://jivebay.com/2009/12/14/rss-cron-job/</link>
		<comments>http://jivebay.com/2009/12/14/rss-cron-job/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 03:45:46 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=233</guid>
		<description><![CDATA[Tired of your web host with limited Cron Jobs, slow caching or think the Poor Man's Cron Job sucks? Try creating an RSS feed and then let Google Reader hit your page and force a RSS Cron Job to take place.]]></description>
			<content:encoded><![CDATA[<p> If you are on shared web host, you might not have the ability to run lots of cron jobs or be limited to a certain number per hour or day. You might know about the &#8220;Poor Man&#8217;s Cron Job&#8221;, which is basically not to run a task (usually caching some data or fetching a feed, api, etc.) in the background until someone visits a page. Which isn&#8217;t ideal, because often the page will be slow or sometimes it won&#8217;t be up to date until the second visit (if you run that task after outputting the cached data).</p>
<p>Well one way to get around this is to setup an RSS feed for the data you are caching or outputting and access it with a query string such as &#8220;?rss=2.0&#8243; or <strong>http://example.com/index.php?rss=2.0</strong>. Then you can check to see if the RSS variable was passed and output a RSS feed with just enough data for a feed, no need to put sensitive data in there or anything. I would suggest putting in a <strong>ttl</strong> node in the RSS feed and set it to something the aggregators like <a href="http://www.google.com/reader">Google Reader</a>, should obey (that way they hit your page more or less frequently, depending on your needs). The <strong>item</strong> portion of an RSS feed only needs a title or a description, although its probably a good idea to put some kind of <strong>guid</strong> in there (check the <a href="http://cyber.law.harvard.edu/rss/rss.html">RSS 2.0 spec</a> for more info on creating RSS feeds).</p>
<p>Anyway here is some sample code. It isn&#8217;t complete but gives you an idea what I mean.<br />
<code><br />
if ($_GET[&#039;rss&#039;] == 2.0)<br />
{<br />
	//create RSS 2.0 feed<br />
	header(&#039;Content-Type: text/xml&#039;);<br />
	$output = &#039;&lt;&#039; . &#039;?xml version=&quot;1.0&quot;?&#039; . &#039;&gt;&#039; . &quot;\n&quot;;<br />
	$output .= &#039;&lt;rss version=&quot;2.0&quot;&gt;&#039; . &quot;\n&quot;;<br />
	$output .= &#039;&lt;channel&gt;&#039; . &quot;\n&quot;;<br />
	//...<br />
	//process your data and output it into RSS 2.0 format<br />
	//...<br />
	$output .= &#039;&lt;/channel&gt;&#039; . &quot;\n&quot;;<br />
	$output .= &#039;&lt;/rss&gt;&#039;;<br />
}<br />
else<br />
{<br />
	//process your data as normal<br />
}<br />
</code></p>
<p>Then to make sure the page is hit often, place your RSS feed into <a href="http://www.google.com/reader">Google Reader</a> or <a href="http://www.bloglines.com/">Bloglines</a> or some other RSS aggregator. Then your site will be visited often and forced to update. No one else really needs to know about your RSS feeds, unless you want them to be public as well.</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=233&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2009/12/14/rss-cron-job/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Email Exposure</title>
		<link>http://jivebay.com/2009/11/03/wordpress-email-exposure/</link>
		<comments>http://jivebay.com/2009/11/03/wordpress-email-exposure/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 12:52:52 +0000</pubDate>
		<dc:creator>blogger</dc:creator>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://jivebay.com/?p=476</guid>
		<description><![CDATA[WordPress Post via e-mail (which allows for posting blogs by checking a POP email address) has a vulnerability of exposing the email address that sent the email. I show you how you can prevent this.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed WordPress&#8217;s blog by email feature has the possibility of allowing anyone to see other email addresses. This feature can be turned on in the <strong>Admin </strong>in <strong>Settings->Writings</strong> and then <strong>Post via e-mail</strong>. Let&#8217;s say you set that email address as <strong>wordpressposts@example.com</strong>, that address will stay hidden. However anyone that emails that address will can have their address exposed on your blog by going to <strong>http://example.com/wp-mail.php</strong> (assuming that&#8217;s where you have WordPress installed at http://example.com). Chances are most people will have this set to a <a href="http://en.wikipedia.org/wiki/Cron">cron job</a> and have it check it every so often, but it might be possible for others to request the page beforehand. And when you do go to that page, it shows something like this:</p>
<pre>
Author is myworkaddress@example.net

Author: 1

Posted title: Some Blog Post Title

Mission complete. Message 1 deleted.
</pre>
<p>Thus, if you are using your a email address you&#8217;d like to keep private and you are emailing wordpressposts@example.com, that email address has the possibility of showing up to people. Which is not good if you email from the same email address that checks the posts. And even worse if you email from a email address for a user in WordPress and has the rights to post contents because the email will get &#8220;publish&#8221; status rather than &#8220;pending&#8221; and will go live on the site. And if someone has the email address that is a user and has posting rights, they can easily send fake emails from that address, because all WordPress checks is the From or Reply-To line (whichever it finds first).</p>
<p>It&#8217;s easy to prevent it from showing email addresses by opening up <strong>wp-mail.php</strong> and looking for this line of code<br />
<code><br />
echo &#039;&lt;p&gt;&#039; . sprintf(__(&#039;Author is %s&#039;), $author) . &#039;&lt;/p&gt;&#039;;<br />
</code></p>
<p>And this line of code<br />
<code><br />
echo &quot;\n&lt;p&gt;&quot; . sprintf(__(&#039;&lt;strong&gt;Author:&lt;/strong&gt; %s&#039;), esc_html($post_author)) . &#039;&lt;/p&gt;&#039;;<br />
</code></p>
<p>And then you could comment those lines out by putting <strong>//</strong> in front of both of them.</p>
<p>I understand WordPress outputs this information so you can see logged from any cron jobs you have setup or if you visit the page manually, as a way of just knowing whats going on. However, it could be done better to prevent the addresses from being shown to everyone. A simple solution is to setup a query string and have a secretkey (don&#8217;t make this your blog&#8217;s password however). For example, lets say your blog is installed at <strong>http://example.com/</strong>, we are going to know require the following URL to check Posts via e-mail <strong>http://example.com/wp-mail.php?secretkey=abc123</strong>. And if someone doesn&#8217;t send the right secretkey, it won&#8217;t check the email address or echo anything out.</p>
<p>So before this line of code<br />
<code><br />
/** Make sure that the WordPress bootstrap has run before continuing. */<br />
</code></p>
<p>Let&#8217;s add<br />
<code><br />
if ($_GET[&#039;secretkey&#039;] != &#039;abc123&#039;)<br />
	exit();<br />
</code></p>
<p>Feel free to change the secretkey to whatever you wish. You can also change it to be called something other than secretkey. If you have a cron job, you&#8217;ll have to point to that new URL as well <strong>http://example.com/wp-mail.php?secretkey=abc123</strong>. If you use the secretkey method you can leave the lines where it echoes out the email address if you like (the 2 lines I showed you could comment out).</p>
<img src="http://jivebay.com/?ak_action=api_record_view&id=476&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jivebay.com/2009/11/03/wordpress-email-exposure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
