Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Redirect http://example.org/@ to a specified Twitter profile.

  • Loading branch information...
commit 8cc855ddbb898f439722d271d8671d14302d84fb 1 parent e3d8c82
Mathias Bynens authored
Showing with 4 additions and 1 deletion.
  1. +1 −0  README.md
  2. +3 −1 index.php
1  README.md
View
@@ -9,6 +9,7 @@
## Features
* Redirect to Twitter when given a numerical slug, e.g. `http://mths.be/8065633451249664``http://twitter.com/mathias/status/8065633451249664`.
+* Redirect to your Twitter account when `@` is used as a slug, e.g. `http://mths.be/@``http://twitter.com/mathias`.
* Redirect to your Google Plus account when `+` is used as a slug, e.g. `http://mths.be/+``https://plus.google.com/u/0/116553353277057965424/posts`.
* Redirect to your main website when no slug is entered, e.g. `http://mths.be/``http://mathiasbynens.be/`.
* Redirect to a specific page on your main website when an unknown slug (not in the database) is used, e.g. `http://mths.be/demo/jquery-size``http://mathiasbynens.be/demo/jquery-size`.
4 index.php
View
@@ -8,7 +8,9 @@
$slug = $_GET['slug'];
- if (' ' == $slug) { // +
+ if ('@' == $slug) {
+ $url = 'http://twitter.com/' . TWITTER_USERNAME;
+ } else if (' ' == $slug) { // +
$url = 'https://plus.google.com/u/0/' . GOOGLE_PLUS_ID . '/posts';
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.