weekly
1.0.0
Vá ao problema com a tag de trabalho para compartilhar projetos/blogs/papers/artigos/notícias interessantes, etc.
Adicione o seguinte alvo à sua barra de favoritos.
Lembre -se de substituir %24YOUR_TOKEN_HERE pelo seu token de acesso pessoal do Github. O token pode ser adquirido nas Settings -> Developer Settings -> Personal Access Token e verificar a permissão public_repo .
javascript : ( function ( ) % 7 Bconst % 20 apiRequest % 20 % 3 D % 20 ( src % 2 C % 20 param ) % 20 % 3 D % 3 E % 20 fetch ( 'https%3A%2F%2Fapi.github.com%2F' % 20 % 2 B % 20 src % 2 C % 20 Object . assign ( % 7 Bheaders % 3 A % 20 % 7 B % 20 Accept % 3 A % 20 'application%2Fvnd.github.v3%2Bjson' % 2 C % 20 'Content-Type' % 3 A % 20 'application%2Fjson' % 2 C % 20 Authorization % 3 A % 20 'token%20%24YOUR_TOKEN_HERE' % 20 % 7 D % 7 D % 2 C % 20 param ) ) % 3 BapiRequest ( 'repos%2Fdyweb%2Fweekly%2Fissues' ) . then ( v % 20 % 3 D % 3 E % 20 v . json ( ) ) . then ( d % 20 % 3 D % 3 E % 20 d . filter ( item % 20 % 3 D % 3 E % 20 item . labels . some ( lab % 20 % 3 D % 3 E % 20 lab . name % 20 % 3 D % 3 D % 3 D % 20 'working' ) ) % 5 B0 % 5 D . number ) . then ( issuenum % 20 % 3 D % 3 E % 20 % 7 Bconst % 20 url % 20 % 3 D % 20 'repos%2Fdyweb%2Fweekly%2Fissues%2F' % 20 % 2 B % 20 issuenum % 20 % 2 B % 20 '%2Fcomments' % 3 Bconst % 20 description % 20 % 3 D % 20 window . prompt ( 'Please%20input%20your%20description%20of%20this%20web%20page%3A' % 2 C % 20 ' ')%3Bconst%20body%20%3D%20description%20%2B%20' % 5 Cn % 5 Cn '%20%2B%20window.location.href%20%2B%20' % 5 Cn % 5 Cn % 20 * Submitted % 20 via % 20 % 5 Bbookmarklet % 5 D ( https % 3 A % 2 F % 2 Fgist . github . com % 2 Fhtfy96 % 2 F301ae2b1c477a4a644e943bbc27c9588 ) * % 20 % 3 Asparkles % 3 A '%3Breturn%20apiRequest(url%2C%20%7Bmethod%3A%20' POST '%2Cbody%3A%20JSON.stringify(%7Bbody%7D)%7D)%7D).then(()%20%3D%3E%20window.alert(' Submission % 20 OK ! ')).catch(ex%20%3D%3E%20%7Bconsole.error(ex)%3Bwindow.alert(' Failed % 20 to % 20 submit ... % 20 See % 20 console % 20 log % 20 for % 20 exception ')%3B%7D)%7D)() 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 + 'nn' + window . location . href + 'nn *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' ) ;
} )Copiado de Bookmarklet simples para enviar a página da web atual para semanalmente
? Agradecimentos especiais a @htfy96!
Se você é um mantenedor semanal de relatórios, consulte o documento semanal do método de manutenção de relatórios para aprender como manter o sistema de relatório semanal.