Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-04-2010, 05:12 PM   #1
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
free goo.gl script for you linux users

Was bored today, this is for you linux users that want to create and decode links using the goo.gl url shortener service.

Code:
#!//bin/bash

# goo.gl link creator and decoder

case "$1" in
create)

if [ $# -ne 2 ] 
then
 echo "url to shorten needed."
 exit
fi
curl -s -d "url=${2}" http://goo.gl/api/url | sed -n "s/.*:\"\([^\"]*\).*/\1/p";
;;

decode)

if [ $# -ne 2 ] 
then
 echo "url to decode needed"
 exit
fi

check=$(echo $2 | sed -n 's/.*\(http:\/\/goo.gl\/[A-Za-z0-9][A-Za-z0-9]*\).*/\1/p');

if [ -n "$(echo $check)" ]; then 
curl -sI $2 | sed -n 's/Location:.* //p';
else
echo "you must give a valid goo.gl link"
fi
;;
*)

echo "Usage: `basename $0` {create|decode}" >&2
exit 64
;;
esac
also posted it on pastebin

http://pastebin.com/bx8zYRUV

enjoy ;)

__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 06:18 PM   #2
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,420
Always giving back to the community. Its funny how many detractors a guy can have when he is making things easier for the entire community.
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 07:06 PM   #3
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Works Good

Code:
$ ./gooShortURL.sh create http://pastebin.com/bx8zYRUV
./gooShortURL.sh: line 13: curl: command not found

$ sudo apt-get install curl
[sudo] password 

$ ./gooShortURL.sh create http://pastebin.com/bx8zYRUV
http://goo.gl/Nljx
$
Had to install curl

Try Link
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 08:00 PM   #4
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
Quote:
Originally Posted by Barry-xlovecam View Post
Works Good

Code:
$ ./gooShortURL.sh create http://pastebin.com/bx8zYRUV
./gooShortURL.sh: line 13: curl: command not found

$ sudo apt-get install curl
[sudo] password 

$ ./gooShortURL.sh create http://pastebin.com/bx8zYRUV
http://goo.gl/Nljx
$
Had to install curl

Try Link
should have added a curl check.

here is the updated code

Code:
#!/bin/bash

# goo.gl link creator and decoder

case "$1" in
create)

if [ $# -ne 2 ] 
then
 echo "url to shorten needed."
 exit
fi
curl -s -d "url=${2}" http://goo.gl/api/url | sed -n "s/.*:\"\([^\"]*\).*/\1/p";
;;

decode)

if [ $# -ne 2 ] 
then
 echo "url to decode needed"
 exit
fi

check=$(echo $2 | sed -n 's/.*\(http:\/\/goo.gl\/[A-Za-z0-9][A-Za-z0-9]*\).*/\1/p');

if [ -n "$(echo $check)" ]; then 
curl -sI $2 | sed -n 's/Location:.* //p';
else
echo "you must give a valid goo.gl link"
fi
;;
*)

if which curl >/dev/null; then 

echo "Usage: `basename $0` {create|decode}" >&2

else 
    echo "curl missing from your system, please install it";
fi 

exit 64
;;
esac
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 08:01 PM   #5
signupdamnit
Confirmed User
 
signupdamnit's Avatar
 
Industry Role:
Join Date: Aug 2007
Posts: 6,697
Nice.
signupdamnit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 08:41 PM   #6
GetSCORECash
Confirmed User
 
GetSCORECash's Avatar
 
Industry Role:
Join Date: Mar 2008
Location: Miami
Posts: 5,527
Thanks!!!!
__________________
| skype: getscorecash | ICQ: 59-271-063 |
New Sites: | SCORELAND2 | Roku Channel SCORETV.TV | 60PLUSMILFS |
| Big Tit Hooker | Tits And Tugs | Big Boobs POV | Karla James |
| Naughty Foot Jobs | Linsey's World | Busty Arianna Sinn | Get SCORE Cash |
GetSCORECash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 10:44 PM   #7
bDok
Confirmed User
 
bDok's Avatar
 
Join Date: Feb 2005
Location: SD/OC/LA
Posts: 1,917
nice. works of course just fine on os x too. Dropped her in /usr/local/bin/

thanx.
http://goo.gl/EQve
__________________
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Warriors come out to plaAAaayyy!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
bDok is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-04-2010, 11:10 PM   #8
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
Quote:
Originally Posted by bDok View Post
nice. works of course just fine on os x too. Dropped her in /usr/local/bin/

thanx.
http://goo.gl/EQve
ya figured it would work fine on osx ;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.