YOURLS API Library
Developers Last Update Started Language Tools License |
Kevin Gardthausen 2013-08-08 2013-07-06 VB.Net 4.0 Visual Studio 2012 GNU GPL v3 |
Visual Basic .NET 4.0 implementation of the YOURLS API (http://yourls.org/#API).
Project includes test project. Also works with Mono framework.
What is YOURLS?
YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or bitly).
Running your own URL shortener is fun, geeky and useful: you own your data and don’t depend on third party services. It’s also a great way to add branding to your short URLs, instead of using the same public URL shortener everyone uses.
Support
- Home Page: https://www.nugardt.com/open-source/yourls-api/
- Code https://github.com/NuGardt/yourls-api
- YOURLS: http://yourls.org/
- Issue Tracking: http://jira.nugardt.com:9080/browse/NYA
- Create issue via e-Mail: nya-jira [at] nugardt [dot] com
- E-mail: [email protected]
- Twitter: https://www.twitter.com/NuGardt
- Facebook: https://www.facebook.com/NuGardt
Download
NuGardt YOURLS API Library
Open source
Download the source at https://github.com/NuGardt/yourls-api
Subversion (SVN):
1 |
svn checkout https://github.com/NuGardt/yourls-api |
Git:
1 |
git clone https://github.com/NuGardt/yourls-api.git |
Created in Microsoft Visual Studio 2012 with Visual Basic .NET 4.0.
Usage
Library is thread safe. Original library is signed by NuGardt.
Creating an instance
1 2 3 4 5 6 7 8 |
Dim Service As YourlsService Dim MyAuth As IYourlsAuthentication Dim Result As YourlsCreateShortUrlResult = Nothing Dim Ex As Exception = Nothing Service = New YourlsService("http://mysite.com/yourls-api.php") MyAuth = New YourlsAuthentication("MyUsername", "MyPassword") |
Calling a method (Sync)
1 2 3 4 5 6 7 8 |
Dim Result As YourlsCreateShortUrlResult = Nothing Dim Ex As Exception = Nothing Ex = Service.CreateShortUrl(Url:="https://www.nugardt.com", Authentication:=MyAuth, Result:=Result, Keyword:="", Title:="") |
Calling a method (Async)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Dim AsyncResult As System.IAsyncResult AsyncResult = Service.CreateShortUrlBegin(Key:="MyAsyncKey", Url:="https://www.nugardt.com", Authentication:=MyAuth, Result:=Result, Keyword:="", Title:="", Callback:=AddressOf MyCallback) Private Sub MyCallback(ByVal Result As IAsyncResult) Dim Ex As Exception Dim Response As YourlsCreateShortUrlResult = Nothing Dim Key As Object = Nothing Ex = Service.CreateShortUrlEnd(Result:=Result, Key:=Key, Response:=Response) '... End Sub |
Calls Service.CreateShortUrlBegin without waiting for the result. When the result is available the callback will be called.
* Key: Can be nothing. Use it for tracking calls.
* Callback: Will be called when the result is available.
License
NuGardt YOURLS API
Copyright (C) 2013 NuGardt Software
https://www.nugardt.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Leave a Reply
You must be logged in to post a comment.