Giter VIP home page Giter VIP logo

weekly's Introduction

周报

投稿方式

GitHub Issue

前往带有 working 标签的 issue 中,分享你看到的有趣/有价值的项目/博客/论文/新闻等

Bookmarklet

Add the following target to your bookmark bar.

Remember to replace %24YOUR_TOKEN_HERE with your Github personal access token. The token could be acquired at Settings -> Developer Settings -> Personal Access Token and check public_repo permission.

javascript:(function()%7Bconst%20apiRequest%20%3D%20(src%2C%20param)%20%3D%3E%20fetch('https%3A%2F%2Fapi.github.com%2F'%20%2B%20src%2C%20Object.assign(%7Bheaders%3A%20%7B%20Accept%3A%20'application%2Fvnd.github.v3%2Bjson'%2C%20'Content-Type'%3A%20'application%2Fjson'%2C%20Authorization%3A%20'token%20%24YOUR_TOKEN_HERE'%20%7D%7D%2C%20param))%3BapiRequest('repos%2Fdyweb%2Fweekly%2Fissues').then(v%20%3D%3E%20v.json()).then(d%20%3D%3E%20d.filter(item%20%3D%3E%20item.labels.some(lab%20%3D%3E%20lab.name%20%3D%3D%3D%20'working'))%5B0%5D.number).then(issuenum%20%3D%3E%20%7Bconst%20url%20%3D%20'repos%2Fdyweb%2Fweekly%2Fissues%2F'%20%2B%20issuenum%20%2B%20'%2Fcomments'%3Bconst%20description%20%3D%20window.prompt('Please%20input%20your%20description%20of%20this%20web%20page%3A'%2C%20'')%3Bconst%20body%20%3D%20description%20%2B%20'%5Cn%5Cn'%20%2B%20window.location.href%20%2B%20'%5Cn%5Cn%20*Submitted%20via%20%5Bbookmarklet%5D(https%3A%2F%2Fgist.github.com%2Fhtfy96%2F301ae2b1c477a4a644e943bbc27c9588)*%20%3Asparkles%3A'%3Breturn%20apiRequest(url%2C%20%7Bmethod%3A%20'POST'%2Cbody%3A%20JSON.stringify(%7Bbody%7D)%7D)%7D).then(()%20%3D%3E%20window.alert('Submission%20OK!')).catch(ex%20%3D%3E%20%7Bconsole.error(ex)%3Bwindow.alert('Failed%20to%20submit...%20See%20console%20log%20for%20exception')%3B%7D)%7D)()

Source code

const apiRequest = (src, param) => fetch('https://api.github.com/' + src, Object.assign({headers: { Accept: 'application/vnd.github.v3+json', 'Content-Type': 'application/json', Authorization: 'token $YOUR_TOKEN_HERE' }}, param));

apiRequest('repos/dyweb/weekly/issues')
    .then(v => v.json())
    .then(d => d.filter(item => item.labels.some(lab => lab.name === 'working'))[0].number) // current issue number
    .then(issuenum => {
        const url = 'repos/dyweb/weekly/issues/' + issuenum + '/comments';
        const description = window.prompt('Please input your description of this web page:', '');
        const body = description + '\n\n' + window.location.href + '\n\n *Submitted via [bookmarklet](https://gist.github.com/htfy96/301ae2b1c477a4a644e943bbc27c9588)* :sparkles:';
        return apiRequest(url, {
            method: 'POST',
            body: JSON.stringify({body})
        })
        })
    .then(() => window.alert('Submission OK!'))
    .catch(ex => {
        console.error(ex);
        window.alert('Failed to submit... See console log for exception');
     })

Copied from Simple bookmarklet to send current webpage to weekly

🎉 Special Thanks to @htfy96!

周报维护方法

如果你是周报的维护者,请参考周报维护方法文档了解如何维护周报系统。

weekly's People

Contributors

gaocegege avatar arrowrowe avatar at15 avatar commouse avatar gaocegege-bot avatar lukexuan avatar swaylq avatar xsfour avatar codeworm96 avatar dependabot[bot] avatar skyzh avatar

Watchers

 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.