Code Monkey home page Code Monkey logo

sh-lib-url-parse's Introduction

sh lib url parse

desc

like nodejs lib 'url'

feat

  • support protocol
  • support host
  • support port
  • support pathname
  • support search

how to use for poduction?

# get the code

# run the index file
# ./index.sh

# or import to your sh file
# source /path/to/the/index file

# usage
url="http://videomy.xx.com:8091/20200126/IPX-xx/index.m3u8"
url_protocol "$url" #it will return "http"
url_host "$url" #it will return "videomy.xx.com"
url_port "$url" #it will return "8091"
url_port ":90" #it will return "90"
url_port "xx.com/xx/xx" #it will return "80"
url_pathname "$url" #it will return "/20200126/IPX-xx/index.m3u8"
url="xx/xx/xx/?appid=aaaa&apidx=0"
url_search "$url" #it will return "?appid=aaaa&apidx=0"
query="appid=aaaa&apidx=0"
parse_url_query $query "appid" #it will return "aaaa"

how to use for developer?

# get the code

# run test
./test.sh
#2 get some fail test
./test.sh | grep "it is false"

author

yemiancheng [email protected]

license

MIT

sh-lib-url-parse's People

Contributors

ymc-github avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.