Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sangupta/as3urlshortener
ActionScript 3 URL Shortening Library
https://github.com/sangupta/as3urlshortener
Last synced: about 2 hours ago
JSON representation
ActionScript 3 URL Shortening Library
- Host: GitHub
- URL: https://github.com/sangupta/as3urlshortener
- Owner: sangupta
- License: other
- Created: 2011-07-04T10:21:35.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-05-03T16:19:59.000Z (over 12 years ago)
- Last Synced: 2024-08-04T05:05:44.198Z (3 months ago)
- Language: ActionScript
- Homepage: http://www.sangupta.com/projects/as3urlshortener
- Size: 117 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actionscript-sorted - as3urlshortener - ActionScript 3 URL Shortening Library (Unsorted / Other API)
README
as3urlshortener
---------------URL Shortening library for ActionScript. Provides convenience classes to shorten URLs via the implemented services, or to expand a given shortened URL.
Currently implementations are available for the following services:
* http://bit.ly
* http://cli.gs
* http://goo.gl
* http://is.gd
* http://shortr.net
* http://tinyurl.com
* http://t.coTypical Usage
-------------```actionscript
IUrlShortner shortener = new BitLyShortner(); // can be replaced with any shortening provider available
public function shortenUrl(url:String):void {
// trace the version
trace('Shortener API version: ' + shortener.version);if(!shortener.supportsAnonymousShortening) {
shortener.authenticate(myUserName, myPasswordOrApiKey);
}
if(shortener.supportsShortening) {
shortener.shortenUrl(url, successHandler, errorHandler);
}
}public function successHandler(response:UrlShortenerResponse):void {
trace('Short url is: ' + response.shortUrl);
// let's expand this to the full URL via the API
if(shortener.supportsExpansion) {
shortener.expandUrl(response.shortUrl, successHandler2, errorHandler);
}
}public function successHandler2(response:UrlShortenerResponse):void {
trace('Original expanded url is: ' + response.longUrl);
}public function errorHandler(event:Event):void {
trace('error occured during url shortening/expansion.');
}
```Versioning
----------For transparency and insight into our release cycle, and for striving to maintain backward compatibility, **as3urlshortener** will be maintained under the Semantic Versioning guidelines as much as possible.
Releases will be numbered with the follow format:
`..`
And constructed with the following guidelines:
* Breaking backward compatibility bumps the major
* New additions without breaking backward compatibility bumps the minor
* Bug fixes and misc changes bump the patchFor more information on SemVer, please visit http://semver.org/.
License
-------Copyright 2011-2012, Sandeep Gupta
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.