From 1843f5bb193176546e0510c778cd4f70513cc4a7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 Mar 2017 10:31:35 +0800 Subject: [PATCH] translated --- .../20170323 3 open source link shorteners.md | 86 ------------------- .../20170323 3 open source link shorteners.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20170323 3 open source link shorteners.md create mode 100644 translated/tech/20170323 3 open source link shorteners.md diff --git a/sources/tech/20170323 3 open source link shorteners.md b/sources/tech/20170323 3 open source link shorteners.md deleted file mode 100644 index 4849e57d9a..0000000000 --- a/sources/tech/20170323 3 open source link shorteners.md +++ /dev/null @@ -1,86 +0,0 @@ -translating---geekpi - -3 open source link shorteners -============================================================ - -> Want to build your own URL shortener? These open source projects make it easy. - - ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") ->Image by : [Paul Lewin][2]. Modified by Opensource.com. [CC BY-SA 2.0][3] - -Nobody likes an impossibly long URL. - -They're hard to decipher. But sometimes, between a deep directory structure on a site, plus a large number of parameters tacked on to the end, URLs just begin to get unwieldy. And back in the days before Twitter added their own link shortener to their service, a long URL meant taking precious characters away from your tweets. - -Today, people use link shorteners for a slew of reasons. They can make it much easier to type, or remember, an otherwise lengthy bare URL. They can bring a consistent branding to a social media account. They make it easier to perform analytics across a group of URLs. They make it possible to provide a consistent entryway to a URL that may change frequently on the other side. - -There are some challenges to URL shorteners, to be sure. They make it challenging to figure out where a link is actually taking you before you click, and they're vulnerable to [linkrot][4], should the service providing the short URL for you ever disappear. But despite these challenges, URL shorteners aren't going anywhere anytime soon. - -But with so many free link shortening services out there, why roll your own? In short: control. While some services will let you pick your own domain to use, sometimes, that's about the level of customization you're going to get. With a self-hosted service, you decide how long your service operates for. You decide what format your URLs take. You decide who has access to your analytics. It's yours to own and operate as you please. - -Fortunately, there are many open source options out there if you want to build the next bit.ly, goo.gl, or ow.ly yourself. Here are a few you might consider. - -### Lessn More - -[Lessn More][5] is a personal URL shortener, built in PHP and forked off of an older project called Buttered URLs, which itself was derived from a fork of a project called Lessn. Lessn More provides most of the features you would expect from a URL shortener: API and bookmarklet support, custom URLs, etc. Some helpful features that set Lessn More apart are the ability to use a banned-words list to avoid creating an accidentally-inappropriate URL, the ability to avoid "lookalike" characters to make URLs more readable, the ability to choose whether or not to use mixed-case characters, and a few other helpful features. - -[Lessn More][6] provides its [source code][7] on GitHub under a 3-clause [BSD][8] license. - -### Polr - -[Polr][9] describes itself as a "modern, powerful, and robust URL shortener." It has a fairly straight-forward but modern interface, and like our other options detailed here comes with an API to allow you to use it from within other programs. Of the three presented here, it's the lightest on features, but if you're looking for a simple but functional option it may be a good choice for you. Check out the [online demo][10] before you download. - -The [source code][11] for Polr can be found on GitHub under a [GPLv2][12] license. - -### YOURLS - -[YOURLS][13], short for Your Own URL Shortener, is the option I am most familiar with. In full disclosure, I ran it for several years in production on a personal site, and was very happy with its capabilities. - -Written in PHP, YOURLS is a pretty feature-rich option that works well out of the box. You can configure it to be publicly usable by anyone, or only allow certain users to use it. It supports custom URLs, comes with a bookmarklet to make sharing easy, has pretty robust built-in stats, and supports a pluggable architecture to allow others to add to it. It also has an API, making it easy to create other programs which interface with it. - -You can find the [source code][14] for YOURLS on GitHub under an [MIT license][15]. - -* * * - -Don't like any of these options? Take a look around the Internet and you can find several other choices: [shuri][16], [Nimbus][17], [Lstu][18], and many others. And beyond the options already available, building a link shortener is a good first programming project to get to know a new language or web framework. After all, the core functionality is very simple: Take a URL as input, and issue a redirect to another URL. Beyond that, it's up to you what bells and whistles to add. - -Do you have a favorite we didn't list here? Let us know in the comments below - --------------------------------------------------------------------------------- - -作者简介: - -Jason Baker - Jason is passionate about using technology to make the world more open, from software development to bringing sunlight to local governments. Linux desktop enthusiast. Map/geospatial nerd. Raspberry Pi tinkerer. Data analysis and visualization geek. Occasional coder. Cloud nativist. Follow him on Twitter. - ------------- - -via: https://opensource.com/article/17/3/url-link-shortener - -作者:[Jason Baker ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jason-baker -[1]:https://opensource.com/article/17/3/url-link-shortener?rate=5EGysFmjsUsxCc74bffDni4sFxxaIYiGRUG3UPznav8 -[2]:https://www.flickr.com/photos/digypho/7905320090 -[3]:https://creativecommons.org/licenses/by/2.0/ -[4]:https://en.wikipedia.org/wiki/Linkrot -[5]:https://lessnmore.net/ -[6]:https://lessnmore.net/ -[7]:https://github.com/alanhogan/lessnmore -[8]:https://github.com/alanhogan/lessnmore/blob/master/LICENSE.txt -[9]:https://project.polr.me/ -[10]:http://demo.polr.me/ -[11]:https://github.com/cydrobolt/polr -[12]:https://github.com/cydrobolt/polr/blob/master/LICENSE -[13]:https://yourls.org/ -[14]:https://github.com/YOURLS/YOURLS -[15]:https://github.com/YOURLS/YOURLS/blob/master/LICENSE.md -[16]:https://github.com/pips-/shuri -[17]:https://github.com/ethanal/nimbus -[18]:https://github.com/ldidry/lstu -[19]:https://opensource.com/user/19894/feed -[20]:https://opensource.com/article/17/3/url-link-shortener#comments -[21]:https://opensource.com/users/jason-baker diff --git a/translated/tech/20170323 3 open source link shorteners.md b/translated/tech/20170323 3 open source link shorteners.md new file mode 100644 index 0000000000..2980bd43f1 --- /dev/null +++ b/translated/tech/20170323 3 open source link shorteners.md @@ -0,0 +1,84 @@ +3 个开源链接缩短器 +============================================================ + +> 想要构建你自己的 URL 缩短器?这些开源项目使这个变得简单。 + + ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") +>图片提供: [Paul Lewin][2]. Modified by Opensource.com. [CC BY-SA 2.0][3] + +没有人喜欢一个非常长的URL。 + +他们很难解析。但有时候,站点的深层目录结构还有最后加上的大量参数使得 URL 开始变得冗长。在 Twitter 添加自己的链接缩短服务之前的那些日子里,一个长的 URL 意味着从推文中消减珍贵的字符。 + +如今,因为很多原因,人们开始使用链接缩短器。这样人们可以更容易地输入或记住另一个冗长的网址。它们可以为社交媒体帐户带来一贯的品牌建设。它们可以更轻松地在一组网址中进行分析。它们使得为其他网站频繁变化的 URL 提供统一的入口成为可能。 + +URL 缩短器确实有一些挑战。应该为你提供短网址服务也会消失,这使得在点击之前知道链接实际指向哪里也是一个挑战,并且容易受到 [linkrot][4] 的影响。但是尽管面临这些挑战,URL 缩短器不会消失。 + +但是,既然已经有这么多免费链接缩短服务,为什么还要自己构建?简而言之:方便控制。虽然有些服务可以让你选择自己的域名来使用,有时候这有关于你会得到定制级别。使用自助式服务,你可以自己决定服务的运行时间、URL 的格式以及决定谁可以访问你的分析。这是你自己拥有并且可以操作的。 + +幸运的是,如果你想建立下一个 bit.ly、goo.gl或 ow.ly,你可以有很多开源选项。你可以考虑下面几个。 + +### Lessn More + +[Lessn More][5]是一个个人 URL 缩短器,用 PHP 写成,并从一个名为 Buttered URL 的较旧项目 fork 而来,而它又是一个名为 Lessn 的项目的分支衍生而来。Lessn More 能提供你对 URL 缩短器预期的大部分功能:API 和书签支持、自定义 URL 等。还有一些有用的功能比如可以让 Lessn More 使用单词黑名单来避免创建意外不适当的 URL、避免“看着相似”的字符来使 URL 更易读、能够选择是否使用混合大小写的字符等。 + +[Lessn More][6] 在 GitHub 上以 3 句版 [BSD][8]许可证公布了 [源代码][7]。 + +### Polr + +[Polr][9] 将自己描述为“现代、强大、可靠的URL缩短器”。它具有相当直接但现代化的界面,像我们这里详细介绍的其他选择那样还提供了一个 API 来允许你从其他程序中使用它。在这三个选择中,它在功能上是最轻的,但如果你正在寻找一个简单但功能完整的选择,那么这可能是你不错的选择。下载之前你可以查看[在线演示][10]。 + +Polr 的[源代码][11] 在 GitHub 中以 [GPLv2][12] 许可证公布。 + +### YOURLS + +[YOURLS][13],“Your Own URL Shortener”(你自己的 URL 缩短器)的缩写,它是我最熟悉的选择。我在个人网站上已经运行了好几年,并且对其功能非常满意。 + +它是用 PHP 编写的,YOURLS 是一个有非常丰富功能的选择并且可以很好地开箱即用。你可以将其配置为任何人可公开使用,或只允许某些用户使用它。它支持自定义 URL,拥有书签功能使得很容易共享,它还具有非常强大的内置统计信息,并支持可插拔的架构,以允许其他人添加功能。它还有一个API,可以轻松地用它创建其他程序。 + +你可以在 Github 中找到 [MIT许可证][15]下的 YOURLS 的[源代码][14]。 + +* * * + +不喜欢这些选择么?看下互联网,你会发现还有其他几个选择:[shuri][16]、[Nimbus][17]、[Lstu][18] 等等。除了这些选择外,构建链接缩短器也是一个很好的第一个编程项目,它可以帮助了解新的语言或 Web 框架。毕竟,它的核心功能非常简单:以 URL 作为输入,并重定向到另一个 URL。除此之外,它取决于你自己想要添加的功能。 + +你有我们没有在这里列出的最爱吗?在评论栏中让我们知道你的想法。 + +-------------------------------------------------------------------------------- + +作者简介: + +Jason Baker - Jason 热衷于使用技术使世界更加开放,从软件开发到阳光政府行动。Linux 桌面爱好者、地图/地理空间爱好者、树莓派工匠、数据分析和可视化极客、偶尔的码农、云本土主义者。在 Twitter 上关注他。 + +------------ + +via: https://opensource.com/article/17/3/url-link-shortener + +作者:[Jason Baker ][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker +[1]:https://opensource.com/article/17/3/url-link-shortener?rate=5EGysFmjsUsxCc74bffDni4sFxxaIYiGRUG3UPznav8 +[2]:https://www.flickr.com/photos/digypho/7905320090 +[3]:https://creativecommons.org/licenses/by/2.0/ +[4]:https://en.wikipedia.org/wiki/Linkrot +[5]:https://lessnmore.net/ +[6]:https://lessnmore.net/ +[7]:https://github.com/alanhogan/lessnmore +[8]:https://github.com/alanhogan/lessnmore/blob/master/LICENSE.txt +[9]:https://project.polr.me/ +[10]:http://demo.polr.me/ +[11]:https://github.com/cydrobolt/polr +[12]:https://github.com/cydrobolt/polr/blob/master/LICENSE +[13]:https://yourls.org/ +[14]:https://github.com/YOURLS/YOURLS +[15]:https://github.com/YOURLS/YOURLS/blob/master/LICENSE.md +[16]:https://github.com/pips-/shuri +[17]:https://github.com/ethanal/nimbus +[18]:https://github.com/ldidry/lstu +[19]:https://opensource.com/user/19894/feed +[20]:https://opensource.com/article/17/3/url-link-shortener#comments +[21]:https://opensource.com/users/jason-baker