The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
timothyye

基于 Go 实现的短网址服务

  •  
  •   timothyye · Dec 2, 2016 · 4342 views
    This topic created in 3623 days ago, the information mentioned may be changed or developed.
    练手写了个短网址服务,框架基于 Iris 实现,前端页面用了 gulp 构建,短网址的存储用的 redis
    6 月挖的坑,中途拖延症爆发,总算在年底前埋了坑……

    网址: http://biturl.top
    GitHub 地址: https://github.com/TimothyYe/biturl
    31 replies  •  2016-12-03 20:33:47 +08:00
    fyibmsd
    fyibmsd
    Dec 2, 2016 via iPhone
    1
    前段时间也搞了一个 https://bitm.pro
    timothyye
    timothyye
    OP
    Dec 2, 2016❤️1
    2
    @fyibmsd 666666
    poemind
    poemind
    Dec 2, 2016
    3
    666
    newworld
    newworld
    Dec 2, 2016 via iPhone
    4
    感谢 开源 一直想学这些,不知楼主对于 php 这方面的短网址有没有了解 解惑一二😬
    timothyye
    timothyye
    OP
    Dec 2, 2016
    5
    @newworld PHP 的没搞过,不过短网址的实现算法应该是差不多的
    outmanone
    outmanone
    Dec 2, 2016
    7
    Golang 不错。。。看代码用 node build JS ,用 docker 来做容器,这样就可以随意发布了。
    newworld
    newworld
    Dec 2, 2016 via iPhone
    8
    @timothyye 好的 谢谢
    @henbf 谢谢 😬
    Zohar
    Zohar
    Dec 2, 2016 via Android❤️2
    9
    支持一下(´・ω・`)
    kslr
    kslr
    Dec 2, 2016❤️1
    10
    设计感觉可以再优化优化,操作部分实在太小了。
    YORYOR
    YORYOR
    Dec 3, 2016 via iPhone
    11
    防碰撞用的什么策略呢 还没来得及去读代码
    lakeview
    lakeview
    Dec 3, 2016
    12
    加个访问统计如何,国内新浪短网址服务都没有统计功能,本来打算 google ,然后想起来国内大多数人访问不到 google:(
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    13
    @lakeview 你是说记录下每个短网址被访问的次数吗?
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    14
    @YORYOR 就是用了网上一个比较通用的短网址算法,一次生成四个短网址,我只是取了其中一个,其实还可以判断这四个是否跟已有短网址重叠,这个代码还可以优化
    lakeview
    lakeview
    Dec 3, 2016
    16
    @timothyye 是的, google 的短网址服务器可以当一个样板, https://goo.gl/
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    17
    @lakeview 谢谢,空了我看看
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    18
    @LazyZhu 谢谢
    lakeview
    lakeview
    Dec 3, 2016
    19
    顺便说下, google 开放了短网址的 api ,大概直接调用就好了,哈哈
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    20
    @scnace 同拖延症……
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    21
    @lakeview API 也可以有
    scnace
    scnace
    Dec 3, 2016 via Android
    22
    @timothyye 人艰不拆 还是加到 TODOs 里面吧。
    raincious
    raincious
    Dec 3, 2016 via Android
    23
    看了下貌似核心代码就 utils.ShortenURL ,感觉没什么意义。不可以加上统计和自定义功能之类。

    而且碰撞处理就是 overwrite ?
    raincious
    raincious
    Dec 3, 2016 via Android
    24
    @raincious

    - 不可以加上统计和自定义功能之类。
    + 可以加上统计和自定义功能之类。
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    25
    @raincious 现在碰撞处理确实是覆盖,哈哈,后期可以优化
    TonyChol
    TonyChol
    Dec 3, 2016❤️1
    26
    我之前试着用 React 写前端的时候也试着写了这么一个类似的服务😂: https://zbcai.xyz
    sfwn
    sfwn
    Dec 3, 2016
    27
    66666 社长
    P0P
    P0P
    Dec 3, 2016
    28
    https://ooo.0o0.ooo/2016/12/03/584235df93fe3.png

    http://biturl.top/qmqmUj
    Cpcong
    Cpcong
    Dec 3, 2016
    29
    @newworld 我前段时间倒是用 php 写过,你可以参考下 https://github.com/Cpcong/roc
    timothyye
    timothyye
    OP
    Dec 3, 2016 via Android
    30
    @P0P 有 bug ,哈哈
    timothyye
    timothyye
    OP
    Dec 3, 2016
    31
    @P0P bug 已修……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4889 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 63ms · UTC 08:00 · PVG 16:00 · LAX 00:00 · JFK 03:00
    ♥ Do have faith in what you're doing.