Twitter @Anywhere Intergration For Wordpress 3.0
Posted on Fri 18th Jun 2010 · Development · 0 Comments
Just playing to try learn more about WordPress as I have taken a drastic disliking to it as of recent, which is probably due to the fact I haven't really given it the time of day so far.
This adds javascript to your header that will activate Twitters @Anywhere API stuff and also add hovercards.
<?php
/*
Plugin Name: Twitter @Anywhere
Description: Add Twitters @Anywhere to Wordpress 3.0
Version: 0.1
Author: Paul Fraser
Plugin URI: http://www.paulOr.net
Author URI: http://www.paulOr.net
*/
function add_twitter_anywhere() {
echo '<script type="text/javascript" src="http://platform.twitter.com/anywhere.js?id=<-- API KEY -->&v=1"></script>'."\n";
echo '<script type="text/javascript">'."\n\t";
echo 'twttr.anywhere(function(twitter) {'."\n\t";
echo 'twitter.hovercards();'."\n";
echo '});'."\n";
echo '</script>'."\n";
}
add_action( 'wp_head', 'add_twitter_anywhere' );
?>
Remember and add your API key...
Posted on Mon 14th Jun 2010 · rand() · 5 Comments
I give up.
<style type="text/css">
* {
border: 0px;
padding: 0px;
margin: 0px;
}
#wrapper {
width: 500px;
margin: 100px auto 20px auto;
}
#head {
border: 10px solid #000000;
-moz-border-radius: 1000px;
min-height: 150px;
width: 180px;
}
#eye1 {
background-color: #fc4303;
border: 10px solid #fc4303;
width: 10px;
height: 10px;
-moz-border-radius: 1000px;
margin: 40px 0 20px 30px;
float: left;
}
#eye2 {
background-color: #fc4303;
border: 10px solid #fc4303;
width: 10px;
height: 10px;
-moz-border-radius: 1000px;
margin: 40px 0 20px 60px;
float: left;
}
#mouth {
border-bottom: 10px solid #000000;
border-left: 10px solid #000000;
border-right: 10px solid #000000;
-moz-border-radius: 0 0 400px 400px;
clear: both;
width: 100px;
margin: 0 0 0 30px;
min-height: 15px;
}
#body {
border-bottom: 10px solid #000000;
border-left: 10px solid #000000;
border-right: 10px solid #000000;
clear: both;
min-height: 200px;
width: 130px;
margin: -25px 0 0 25px;
-moz-border-radius: 125px 125px 1000px 1000px;
float: left;
}
#arm1 {
float: left;
border-left: 10px solid #000000;
min-height: 80px;
-moz-border-radius: 125px 125px 1000px 1000px;
}
</style>
<div id="wrapper">
<div id="ball"></div>
<div id="bent">
</div>
<div id="spike">
</div>
<div id="head">
<div id="eye1">
</div>
<div id="eye2">
</div>
<div id="mouth">
</div>
</div>
<div id="arm1">
</div>
<div id="body">
</div>
<div id="arm2">
</div>
</div>
FaceTime? Face Palm More Like...
Posted on Wed 9th Jun 2010 · Real Life · 3 Comments
Back in 2007 (the same year as the first iPhone was released) I was sporting a Nokia N95. No one else seems to have picked up on this, so Ill say it, Ill burst the bubble.
My Nokia N95 had a front facing camera which done video calls. Yeah. It did. - Wait. No, yea, it did.
Quotes from the iPhone 4 promo video:
"We're bringing video calling, to the world!" <-- No, no your not, Its been done, Is done, and on a better scale. No wifi? oh well..
"Its going to change the way we communicate, forever." <-- Wrong.
"The first time i had a facetime call, i was blown away!" <-- Fair enough Scott. You did make it. Your allowed to be impressed by your own work.
"what makes it even better, is it switches from the front camera, to the back camera!" <-- Yea, my 3 year old Nokia N95 STILL does that.
Yea so whatever. Just saying.
Discuss.
Function: Convert Days Into Seconds w/ PHP
Posted on Tue 8th Jun 2010 · Development · 0 Comments
While making the stats program for the backend of paulOr.net that shows me daily unique & page views in a graph for the past ten days, I needed a really easy way of calculating the amount of seconds in each day so that I could then do quick database querys without much code to grab the total amounts of visiters per day. My solution was this very quick function which converts the amount of days into seconds.
Theres quite a bit more that goes on behind the scenes but this is by far the simpliest form of what goes on. Perhaps others will find it useful also :]
Function: Convert Days To Seconds
<?php
## DAYS INTO SECONDS
function days_to_seconds($days) {
if(is_numeric($days)) {
return 86400*$days;
} else {
return 'string must be numeric';
}
}
## PARSE
echo days_to_seconds(8); // NUMBER OF DAYS
## RESULT
// 691200
?>