Comments (4)
you have a typo : s/gitst/gists/
from if_ms_buys_github_imma_out.
For now I only have a workaround : "convert all gists to a repository".
I created a repository and import each gist in one separated branch.
git clone all_my_gist_url gists
git clone one_gist_url one_gist
cd gists
git fetch ../one_gist
git checkout -b one_gist FETCH_HEAD
from if_ms_buys_github_imma_out.
#!/usr/bin/env node
const exec = require('child_process').exec
const https = require('https')
console.log(`Fetching gists data of user ${process.argv[2]}`)
function execute(command) {
exec(command, (err, stdout, stderr) => {
process.stdout.write(stdout)
})
}
function request(path) {
const options = {
hostname: 'api.github.com',
path,
method: 'GET',
headers: { 'User-Agent': 'Mozilla/5.0' }
}
return new Promise((resolve, reject) => {
let body = ''
https.get(options, res => {
res.on('data', data => body += data)
res.on('end', () => resolve(body))
})
})
}
request(`/users/${process.argv[2]}/gists`)
.then(data => {
return JSON.parse(data)
})
.then(gists => {
console.log(gists)
gists.forEach(gist => {
const file = Object.keys(gist.files)[0]
console.log('Found gist ' + file)
console.log(`Cloning ${gist.git_pull_url} into ${file}...`)
exec(`git clone ${gist.git_pull_url} ${file}`)
})
})
.then(() => console.log('Waiting for the magic.....'))
I ended up writing a script myself to do the job. But this script just works on public gists only.
Just create clone.js
file with script above, then run clone.js your_account
. Next step is to auto push those gists to gitlab smh.
BTW, I'm not sure if it works on Windows 😕
from if_ms_buys_github_imma_out.
Thanks mate.
I also found gitlab api documents to create snippets here. https://docs.gitlab.com/ee/api/snippets.html#create-new-snippet
I will try to write step 2 soon.
from if_ms_buys_github_imma_out.
Related Issues (20)
- Edit Bio And Fork The Repo To Spread The Word HOT 8
- troll HOT 1
- Code HOT 6
- troll
- Paranoia or actual fact? HOT 11
- Copy GitHub stars to GitLab HOT 6
- Maybe havent being censored? HOT 2
- Update Licensing for MSFT HOT 12
- sorry HOT 2
- This is all my mistake. Time to reset. HOT 39
- Savannah/Savane HOT 3
- Don't forget.. HOT 5
- GitHub Evacuation Center Discord HOT 1
- Licensing issues HOT 1
- This is retarded HOT 9
- Gitlab Sucks
- Please stay HOT 3
- whore_out_now
- Help us HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from if_ms_buys_github_imma_out.