<?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>BREAKZ &#187; Geek Stuff</title>
	<atom:link href="http://www.breakzdjs.com/category/geek-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.breakzdjs.com</link>
	<description>: Electronic music in York . Drum &#38; Bass . Dubstep</description>
	<lastBuildDate>Wed, 05 Oct 2011 11:54:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Beautifying York Lists with AJAX</title>
		<link>http://www.breakzdjs.com/2009/02/02/beautifying-york-lists-with-ajax/</link>
		<comments>http://www.breakzdjs.com/2009/02/02/beautifying-york-lists-with-ajax/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 02:15:40 +0000</pubDate>
		<dc:creator>Breakz</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>

		<guid isPermaLink="false">http://www.breakzdjs.com/2009/02/02/beautifying-york-lists-with-ajax/</guid>
		<description><![CDATA[How to use a little AJAX magic to hide the York lists service and give your site visitors a much slicker experience when they subscribe to your mailing list. We&#8217;ve looked after our own mailing list for years. We had a nice database of users hosted on the website that was pretty flexible, easy for [...]]]></description>
			<content:encoded><![CDATA[<p><em>How to use a little AJAX magic to hide the York lists service and give your site visitors a much slicker experience when they subscribe to your mailing list.</em></p>
<p>We&#8217;ve looked after our own mailing list for years.  We had a nice database of users hosted on the website that was pretty flexible, easy for us to use and very easy to which to sign up.  </p>
<p>But sending out mail is another matter entirely.  We currently have around 700 addresses on our list, and it has become increasingly difficult to find a server that is prepared to send out that many messages.  We had to resort to splitting mailouts, VPNing to York and dodging angry system administrators in order to get our mail out.  And culling the dead emails from the list wasn&#8217;t much fun either.  </p>
<p>So we&#8217;ve finally given up and got a <a href="https://lists.york.ac.uk/">York Lists account</a>.  In many ways it&#8217;s great: emailing the list is now as easy as, um, sending an email, and it deletes invalid addresses automatically.  </p>
<h3>A nice personality</h3>
<p>But it&#8217;s a bit of an ugly thing.  We used to have <a real="nofollow" href="http://www.breakzdjs.com/members-old/">this signup form</a>.  The lists service gave us <a href="https://lists.york.ac.uk/mailman/listinfo/breakz-soc">this one instead</a>.  It doesn&#8217;t match the rest of the site and provides far too much useless information on screen.  </p>
<p>It would be nice to use the old signup form with our new lists account.  And luckily we can.  </p>
<p><span id="more-59"></span></p>
<h3>Submitting to the lists service</h3>
<p>First, create a form that submits to the lists service.  I made this by copying the fields from the <a href="https://lists.york.ac.uk/mailman/listinfo/breakz-soc">lists subscription form</a>.   Change the form action to point at your list.  I&#8217;ve hidden a few of the fields as I don&#8217;t consider them important.  </p>
<pre>
&lt;form class="SubscribeForm" method="post" action="https://lists.york.ac.uk/mailman/subscribe/breakz-soc"&gt;
&lt;h3&gt;Sign me up!&lt;/h3&gt;

&lt;label for="name"&gt;Name&lt;/label&gt;
&lt;input class="SubscribeText" id="name" type="text" name="fullname" size="35" maxlength="255" /&gt;

&lt;label for="email"&gt;Email&lt;/label&gt;
&lt;input class="SubscribeText" id="email" type="text" name="email" size="35" maxlength="255" /&gt;

&lt;input type="hidden" name="pw" value="" /&gt;
&lt;input type="hidden" name="pw-conf" value="" /&gt;
&lt;input type="hidden" name="digest" value="0" /&gt;

&lt;input class="SubscribeSubmit" type="submit" name="email-button" value="Subscribe" title="Click to submit details and join mailing list." /&gt;
&lt;/form&gt;
</pre>
<p>The form should now work nicely, but unfortunately you&#8217;ll end up on the lists service site after submitting.  It would look a lot more professional if we could stay on site throughout.  </p>
<h3>Keeping it on the site</h3>
<p>And we can do this with a bit of AJAX.  When someone submits the form, we send the data on to the lists service, get back its response and return a success (or failure) message.  The AJAX itself is pretty simple, but unfortunately we&#8217;re not allowed to send data cross domain for security reasons.  </p>
<p>Luckily we can get round this by using an AJAX proxy, which takes a local request and redirects it to an external domain.  The one I used is the <a href="http://www.iacons.net/writing/2007/08/02/ajax-cross-domain-proxy/">PHP AJAX proxy</a> by Iacovos Constantinou.    </p>
<p>We need to add a couple more elements to the form so we can give feedback to the user.  I stuck these just after the submit button.</p>
<pre>
&lt;img id="ajaxBusy" src="http://www.breakzdjs.com/images/progress.gif" alt="Busy..." /&gt;
&lt;div id="ajaxResult"&gt;&lt;/div&gt;
</pre>
<p>Apart from that, the form is identical.  (So it still works for those without JavaScript.)</p>
<h3>Driving the form with JavaScript</h3>
<p>I used <a href="http://jquery.com/">jQuery</a> because I think it&#8217;s great.  Along with other JavaScript libraries, it has a nice, high level interface to the AJAX functionality.  </p>
<p>The code below intercepts the form submit function and posts the form data on to the AJAX proxy.  Once we get a return value from the AJAX proxy (the &#8216;thanks for subscribing&#8217; HTML page from the lists server), we process it to see what the list server said.  The server success or error message is between the <code>&lt;/h1&gt;</code> tag and the <code>&lt;hr&gt;</code> (sic.) tag, so we use a regexp to cull the rest.  </p>
<p>The list server returns a verbose (and largely uninteresting) message if the subscription succeeds, starting with &#8220;Your subscription request has been received, and will soon be acted upon.&#8221;  We search for that and, if it&#8217;s there, show a rather terser and to-the-point message for the user.  If not, tell the user there&#8217;s a problem and print the server response.  The code also throws up a link to the lists server subscribe page, just in case something funny is going on at this end.  </p>
<pre>
jQuery(document).ready(function()
{
	var ajaxProxy = "http://www.breakzdjs.com/ajax-proxy.php";
	var listUrl = "https://lists.york.ac.uk/mailman/subscribe/breakz-soc";
	var signupUrl = "https://lists.york.ac.uk/mailman/listinfo/breakz-soc";

	jQuery("form.SubscribeForm").submit(function()
	{
		jQuery("#ajaxBusy").show();

		jQuery.post(ajaxProxy,
		{
			csurl: escape(listUrl),
			fullname: jQuery("#name").val(),
			email: jQuery("#email").val(),
			pw: "",
			digest: "0"
		},
		function(data)
		{
			jQuery("#ajaxBusy").hide();

			// Remove HTML guff.  Interesting bit is between &lt;/h1&gt; and &lt;hr&gt;.
			data = data.replace(/(^(.|\n)*&lt;\/h1&gt;|&lt;hr&gt;(.|\n)*$)/gi, "");

			// Failed
			if (data.search("Your subscription request has been received, and will soon be acted upon.") == -1)
			{
				jQuery("#ajaxResult").html("&lt;h3&gt;Ooh dear.  Something went wrong.&lt;/h3&gt;&lt;p&gt;" + data + "&lt;/p&gt;&lt;p&gt;Keeps going wrong?  &lt;a href=\"" + signupUrl + "\"&gt;Try signing up on the mailing list server&amp;nbsp&amp;raquo;&lt;/a&gt;&lt;/p&gt;").fadeIn("fast");
			}
			else
			{
				jQuery("#ajaxResult").html("&lt;h3&gt;Thanks!&lt;/h3&gt;&lt;p&gt;You should get an email from the list service we use to confirm your subscription.  Just click the link in that and you&amp;rsquo;re done.&lt;/p&gt;").fadeIn("fast");
			}
		});

		return false;
	});
});
</pre>
<h3>Ready to rumble</h3>
<p>And that&#8217;s it.  See it in action</p>
<ul>
<li>On our <a href="http://www.breakzdjs.com/members/">new subscribe page</a></li>
<li>On the <a href="http://www.yupe.co.uk/subscribe.php">Pole Exercise site</a></li>
<li><a href="http://www.poleexercise.co.uk/download/dev/code/ajax-york-lists.zip">Download the code</a></li>
</ul>
<p>Don&#8217;t forget to edit all of the files so they point to your lists URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breakzdjs.com/2009/02/02/beautifying-york-lists-with-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Set Up YUSU Gmail</title>
		<link>http://www.breakzdjs.com/2007/11/08/how-to-set-up-yusu-gmail/</link>
		<comments>http://www.breakzdjs.com/2007/11/08/how-to-set-up-yusu-gmail/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 01:50:56 +0000</pubDate>
		<dc:creator>Breakz</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>

		<guid isPermaLink="false">http://www.breakzdjs.com/2007/11/08/how-to-set-up-yusu-gmail/</guid>
		<description><![CDATA[As part of their website redesign, YUSU have added Google Apps support to give each club and society a nice big Gmail account. Like a lot of societies, after some deliberation we decided to make the move from our old York socs account. Things have been largely positive, but there are a few gotchas we&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.breakzdjs.com/images/articles/gmail-logo-200.jpg" class="Left" alt="Gmail logo" title="Gmail logo">As part of their website redesign, <a href="http://www.yusu.org/">YUSU</a> have added <a href="https://www.google.com/a/">Google Apps support</a> to give each club and society a <a href="http://mail.yusu.org/">nice big Gmail account</a>.  Like a lot of societies, after some deliberation we decided to make the move from our old York socs account.  </p>
<p>Things have been largely positive, but there are a few gotchas we&#8217;ve come up against so far.  I&#8217;m going to provide a quick setup guide and then outline these issues so you hopefully don&#8217;t have to follow the same (occasionally torturous) path we did.<br />
<span id="more-41"></span></p>
<h3>Should I switch to Gmail?</h3>
<p>Advantages:</p>
<ul>
<li>Much more space (4GB vs. 50MB)</li>
<li>Emails not eaten by MessageLabs &ndash; MessageLabs is the spam solution used on the York email accounts.  Although effective, it does sometimes delay (by hours or days) a significant number of legitimate messages, or occasionally doesn&#8217;t deliver them at all.</li>
<li>The web access interface is much nicer than the York one</li>
</ul>
<p>Disadvantages:</p>
<ul>
<li>Spam protection not quite as good &ndash; We get about 200 spam messages per day through to Breakz.  Almost all are filtered out, but Gmail seems slightly worse than MessageLabs was.</li>
<li>Unclear about the TOS / SLA / privacy (though this is largely true for the York solution too)</li>
<li>Getting mail out of Gmail if you or YUSU decide to move to another system at some point (this can be overcome with POP / IMAP &ndash; see below)</li>
</ul>
<p>So it seems like a good thing to do.</p>
<h3>Setting it all up</h3>
<p><a href="http://mail.yusu.org/">Log in</a> to Gmail.  Change your name in the settings bit (top right).  </p>
<p>Go to the <a href="https://www-db.york.ac.uk/cgi-bin-auth/edesk_email">York email settings page</a> (use your socs account to log in) and set the account to forward to your new YUSU address (&#8220;please divert my mail to&#8221;).  </p>
<p><strong>Anything else?</strong></p>
<p>If you&#8217;re just planning on sending a few messages and only using the Gmail web interface then you&#8217;re done.  Pat yourself on the back and go and have a coffee or something.  Go on, shoo!</p>
<p>Otherwise, please read on&#8230;</p>
<h3>Using your own domain</h3>
<p>For a number of years, we&#8217;ve used <a href="mailto:info@breakzdjs.com">info@breakzdjs.com</a> as our public-facing address.  Until recently, this just forwarded to our socs account.  We&#8217;ve now changed this so it goes to the Gmail one instead.  </p>
<p>As well as looking more professional, this solution means we can move the actual location of our email around (as we have just done) without changing our contact details.  If you&#8217;d like to do something similar, your host&#8217;s control panel should have email forwarding options.</p>
<p>If you do this and use the Gmail web interface, you should set up a reply-to address in the Gmail settings so mail doesn&#8217;t appear to return to your YUSU account.  You should also do this in your mail client if you&#8217;re using the Gmail SMTP server (see next) as Gmail will helpfully change the from address to your @yusu.org one.  </p>
<h3>Accessing Gmail through an email client</h3>
<p>If you&#8217;d rather read your mail with Outlook or Thunderbird (and I have no idea why you wouldn&#8217;t want to), Gmail supports both POP and IMAP access.  You can enable both via the web interface&#8217;s settings bit (Forwarding and POP/IMAP tab).  </p>
<p>Google&#8217;s implementation of POP is non-standard, as it tries to sync your web and local inboxes.  This works fine with just one person reading the mail, but breaks if (as is likely) more than one person is accessing the account via POP.  The first person gets messages delivered as expected, but <a href="http://blog.chilkatsoft.com/?p=184">subsequent people will get nothing</a>.  Clearly, this is shit.  (It also breaks if you read the mail on more than one computer.)</p>
<p>A much better choice is Gmail&#8217;s recently released IMAP option (as used by York for the past 10+ years).  At the moment, <a href="http://mail.google.com/support/bin/answer.py?answer=79344">to get IMAP to show up</a>, you have to <a href="https://mail.google.com/support/bin/answer.py?answer=17091">set the interface language to &#8216;English (US)&#8217;</a>.  </p>
<p><strong>Update:</strong> The way Gmail does IMAP is non-standard too.  In particular, deleting a message from the inbox does not, actually, delete it.  There&#8217;s a list of how IMAP and Gmail actions sync <a href="http://mail.google.com/support/bin/answer.py?answer=77657&#038;topic=12762">here</a>.</p>
<p>Google guides:</p>
<ul>
<li><a href="http://mail.google.com/support/bin/topic.py?topic=1555">How to set up POP access</a></li>
<li><a href="http://mail.google.com/support/bin/topic.py?topic=12760">How to set up IMAP access</a></li>
</ul>
<h3>Sending to large mailing lists</h3>
<p>Gmail places quite tight restrictions on the number of emails you can send per day.  <a href="https://mail.google.com/support/bin/answer.py?answer=22839&#038;topic=1526">It&#8217;s only possible to email 500 people per day</a> from the web interface, and just 100 via Google&#8217;s SMTP server.  If, like us, you have over 500 people on your mailing list, this is clearly useless.  </p>
<p>There are two principal ways round this:</p>
<ul>
<li>Use a list management service</li>
<li>Use a different email server</li>
</ul>
<h3>Using a list management service</h3>
<p>The university provides a <a href="http://lists.york.ac.uk/">mailing list service</a> that quite a few societies already use.  There&#8217;s info on the site about how to apply for one.  </p>
<p>You could also consider the YUSU mailing / membership list service (part of the new website &#8211; log in as your society to access), though when I tried it briefly it appeared to be rather unfriendly and somewhat broken.  </p>
<p>We don&#8217;t use either of these options as we want to be able to record more information about our members (e.g. whether they are interested in DJ lessons), occasionally need to email specific groups (newly registered, DJs, etc.) and want to allow people to <a href="http://www.breakzdjs.com/members/">join the list via our site</a>.  </p>
<h3>Using a different email server</h3>
<p>If you&#8217;re on campus, you can get round this by using the York SMTP server.  Get rid of the Gmail outgoing server settings (don&#8217;t forget to reset the authentication to default) and enter smtp.york.ac.uk instead.  </p>
<p>If you&#8217;re off campus, you may be able to use your ISP&#8217;s server (check with your ISP for settings).  However, quite a few ISPs are even stricter than Gmail on sending email.  If you&#8217;re with one of them, you can use the York SMTP server once you&#8217;ve connected to the university <a href="http://www.york.ac.uk/library/elibrary/webcache.htm">web cache</a> or <a href="http://www.york.ac.uk/services/cserv/net/vpn/">VPN</a>.  (You may also be able to use your department&#8217;s email server and VPN instead.)  Unfortunately this means you&#8217;ll have to connect to the VPN each time you want to send an email to your mailing list.  </p>
<p><em>Think that&#8217;s it!  Hope that helps &ndash; otherwise, post a comment or get in touch.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.breakzdjs.com/2007/11/08/how-to-set-up-yusu-gmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

