A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: Untitled - Stikked
From Scanty Curlew, 10 Years ago, written in Python.
This paste is a reply to Untitled from Bulky Owl - view diff
Embed
  1. #!/usr/bin/env python
  2.  
  3. # Import the modules
  4.  
  5. import bitlyapi
  6. import sys
  7.  
  8. # Define your API information
  9.  
  10. API_USER = "your_api_username"
  11. API_KEY = "your_api_key"
  12.  
  13. b = bitlyapi.BitLy(API_USER, API_KEY)
  14.  
  15. # Define how to use the program
  16.  
  17. usage = """Usage: python shortener.py [url]
  18. e.g python shortener.py http://www.google.com"""
  19.  
  20. if len(sys.argv) != 2:
  21.     print usage
  22.     sys.exit(0)
  23.  
  24. longurl = sys.argv[1]
  25.  
  26. response = b.shorten(longUrl=longurl)
  27.  
  28. print response['url']