Pages

Showing posts with label Sports. Show all posts
Showing posts with label Sports. Show all posts

Optrix Extreme Sports Case

If you love getting an adrenaline rush simply because your life at the office is very boring, then you might want to live it up a little whenever you have ditched the tie and suit. Enter the £69.99 Optrix Extreme Sports Case, which is a device that can be mounted on helmets in a jiffy. Not only that, it is full well capable of being riveted on to handlebars, boards and perhaps even car bonnets if you are up to it. Just like how you need some safety gear for your precious iPhone, just like how you pad yourself up with knee pads and a mouth-guard whenever you get involved in a rough sport or potentially risky activity.

The Optrix Extreme Sports Case will feature special anti-vibration sleds that ensure the video recordings remain nice and smooth. Not only that, the addition of the transparent touchscreen membrane would mean that you are free to review all of the recorded action live, with the option of saving it up for editing later on one of the compatible video Apps. Constructed using military-grade materials and using ‘ultrasonic welding’ techniques and silicon gaskets, the Optrix Extreme Sports Case is water-resistant to boot, so what are you waiting for?

Read more >>

Vygor Italian sports car designed by Ron Burgundy?

The Vygor is Italy’s newest supercar. There are very few confirmed details about this mysterious stallion, which will be unveiled on October 10. It may or may not be called the n.01, according to some reports.

This teaser is currently the only image we have of the Vygor. Clearly, it has an aggressive face with sculpted LEDs and a seemingly long bonnet.

Judging by the short press release that accompanied the image, it also appears the car may have been designed by Ron Burgundy.
The company says Vygor embodies “the emotion of touching a panther”. It is a “unique work of art challenging the road with proud eyes, the body sinuous like a feline and the elegance of a dream”.
Vygor promises an “emotional car”, describing the thunder of the engine as “pure adrenalin, aggressive and biting as you have always dreamt but also mild as silk”.
It’s charmingly poetic, and we can hardly wait to see if the actual car lives up to the hype.
The Vygor is the latest in a string of sports car unveiled recently, following the Eterniti Hemera, Rimac Concept One and the Arrinera from Poland.
Read more >>

Super simple way to work with Twitter API (PHP + CSS)

In this post I want to illustrate a super simple way to work with Twitter API and PHP. In particular, this tutorial explains how to get public updates from Twitter public timeline and display them in a web page with a custom style using CSS. In order to get Twitter updates I used Twitterlibphp (a PHP implementation of the Twitter API) that allows you to take advantage of it from within your PHP applications.

Using this simple method you can obtain awesome results like this:


You can download the source code at the following link and reuse it for free in your web projects (you need PHP and APACHE):




1. A little introduction
Twitterlibphp returns Twitter timeline in XML format and with this structure (take a look at the Twitter API home page for a full list of available nodes.):

status
created_at
id
text
source
user
name
screen_name
description
profile_image_url
url
followers_count
...
...
But how you can display them? It's very simple! Take a look at the following code!


2. PHP code
Create a new file twitter_status.php and copy and paste the following code:

<div class="twitter_container">
<?php
// require the twitter library
require "twitter.lib.php";

// your twitter username and password
$username = "your_username";
$password = "your_password";

// initialize the twitter class
$twitter = new Twitter($username, $password);

// fetch public timeline in xml format
$xml = $twitter->getPublicTimeline();

$twitter_status = new SimpleXMLElement($xml);
foreach($twitter_status->status as $status){
foreach($status->user as $user){
echo '<img src="'.$user->profile_image_url.'" class="twitter_image">';
echo '<a href="http://www.twitter.com/'.$user->name.'">'.$user->name.'</a>: ';
}
echo $status->text;
echo '<br/>';
echo '<div class="twitter_posted_at">Posted at:'.$status->created_at.'</div>';
echo '</div>';
}
?>
<div>


How you can see, the previous code is very simple to understand. The line:

$xml = $twitter->getPublicTimeline();

get the 20 most recent public statuses posted. You can also use other functions such as:

getFriendsTimeline(): returns the 20 most recent statuses posted by the authenticating user and that user's friends.

- getUserTimeline(): returns the 20 most recent statuses posted from the authenticating user.

getReplies(): returns the 20 most recent @replies (status updates prefixed with @username) for the authenticating user.

Take a look at twitter.lib.php for the full list of available functions.

If you want to display different information, for example the source of the update (status->source) use this code:

$status->source

...or if you want to display the number of followers of the current user (follower_count) use this code:

$user->followers_count


3. CSS Code
Now you can customize the style of your timeline using CSS code. I used the following classes but you can customize the look how you prefer:

.twitter_container{

color:#444;
font-size:12px;
width:600px;
margin: 0 auto;

}
.twitter_container a{

color:#0066CC;
font-weight:bold;

}
.twitter_status{

height:60px;
padding:6px;
border-bottom:solid 1px #DEDEDE;

}
.twitter_image{

float:left;
margin-right:14px;
border:solid 2px #DEDEDE;
width:50px;
height:50px;

}
.twitter_posted_at{

font-size:11px;
padding-top:4px;
color:#999;

}


That's all! Download the source code, open twitter_status.php, change $username and $password with your Twitter username and password and upload the file in your test server.
If you have some suggestion, please add a comment!

Read more >>
Next Post