Code Monkey home page Code Monkey logo

download_latest's Introduction

download_latest

Download files from the latest release.

Test this as

How to download a file of the latest release

Download file by name

In your markdown files in the repository or in your github pages, add a link:

https://niccokunzmann.github.io/download_latest/<FILE>
https://niccokunzmann.github.io/download_latest/<USER>/<REPOSITORY>/<FILE>

Replace <FILE> with the name of the file to download from the releases. If you want to specify repository and user, you can do so.

Download file by index

If you are looking for a static way to download a file with index, without taking consideration of the file name, this is the option you are looking for

Ad the query parameter to the url like this: ?index=0..n

  • The first file has index 0.
  • When index is set, it downloads the file with that index from the latest release files. Example: ?index=5
  • If index is not set, the first file is downloaded. ?index=
  • If the index parameter is set, the file name is ignored.
https://niccokunzmann.github.io/download_latest/chlegou/bitbot/?index=0 // will download the 1st file in the latest release 
https://niccokunzmann.github.io/download_latest/chlegou/bitbot/?index=5 // will download the 6th file in the latest release 

IMPORTANT: In case of multiple files, you must take consideration of the files' order in the releases. They must follow the same order always. Adding files may break the order.

Contribute

If you like to add a feature, please create a pull-request. We want to follow CCCC.

Related Work

This was creates as an answer to this Stackoveflow question.

Credits

Work by niccokunzmann and chlegou.

download_latest's People

Contributors

chlegou avatar dependabot[bot] avatar niccokunzmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

download_latest's Issues

download the first element if no <FILE> was set in URL

Hi there,

First thanks for the clever lib you made! πŸ‘ really nice!

i wanted to add an enhancement, when passing empty <FILE> in url, we are getting error, (which is obvious) but instead, could we make it download the first file by default (if there is existing files already)?
so, this url:
https://niccokunzmann.github.io/download_latest/<USER>/<REPOSITORY>/
will download the first file in release (since it's null) if it exist.

this feature could be awesome!

For more enhancement, we could play around with it:
https://niccokunzmann.github.io/download_latest/<USER>/<REPOSITORY>/0/
https://niccokunzmann.github.io/download_latest/<USER>/<REPOSITORY>/1/

will respectively download files by indexes in the release files.
(testing by regex, if it ends with "%d/")

if this wasn't accepted, could you at least make the wabpage accept it as a query?
so, this url:
https://niccokunzmann.github.io/download_latest/<USER>/<REPOSITORY>/?index=0
https://niccokunzmann.github.io/download_latest/<USER>/<REPOSITORY>/?index=1

will always download files by indexes instead of returning error!

like that, we will never add the file names and URLs becomes static!! πŸ˜ƒ

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.