Skip to content

Instantly share code, notes, and snippets.

@Arsenalist
Arsenalist / check.php
Last active December 22, 2015 04:19
A PHP script to check whether the Mesut Ozil signing has been announced on the Arsenal.com RSS feed.
<?php
while (true) {
$contents = file_get_contents('http://feeds.arsenal.com/arsenal-news');
if (stripos($contents, 'mesut') !== FALSE) {
echo date(DATE_RFC822) . ": It's official!\n";
mail('PUTYOUREMAIL@HERE.COM', 'Arsenal signed Ozil', '');
exit(0);
} else {
echo date(DATE_RFC822) . ": Nothing doing.\n";
sleep(10);
// #1 - Using a function
function Apple (country) {
this.country = country;
this.color = "red";
this.getInfo = getAppleInfo;
}
function getAppleInfo() {
return this.country + ' has ' + this.color + 'apples'.;
}
@Arsenalist
Arsenalist / randon-tips.html
Created September 27, 2012 04:35
Display random tips using jQuery
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
</head>
<body>
<h1>Show Random Tip</h1>
<ul id="tips" style="display:none">
<li>Dinner is good for you.</li>