alcatraz / Alcatraz

Package manager for Xcode
alcatraz.io
MIT License
9.88k stars 1.15k forks source link

Quickly give a plugin (github) star in Xcode Package Manager #456

Open azurechen opened 8 years ago

azurechen commented 8 years ago

It may not need to display the stars number as issue-422 mentioned. But I think adding a button to quickly star a plugin can encourage the developer.

jurre commented 8 years ago

You need to be logged in to github to star repositories, so this feature would mean we'd need a way to let users log in to GH in Alcatraz right?

azurechen commented 8 years ago

Yes, I think the login feature is necessary, it may not be easy but it is possible. @jurre How do you think?

jurre commented 8 years ago

Is it really that much extra work to just use the github link and star it there?

azurechen commented 8 years ago

I am always lazy to open the link and star it, I don't know how the other users thinking. Just an idea for your reference :)

azurechen commented 8 years ago

But I think the work is not quite hard, according to the API doc https://developer.github.com/v3/activity/starring/

To star a repo, just run the following command curl -i -u user:name -X PUT https://api.github.com/user/starred/:owner/:repo

Example curl -i -u azurechen:******* -X PUT https://api.github.com/user/starred/azurechen/R.swift-plugin

Removing the star is easy too curl -i -u user:name -X DELETE https://api.github.com/user/starred/:owner/:repo

It may be the easiest way to star/unstar a repo. But store the username and password in Alcatraz app is necessary.

Another way is using OAuth2 and get authorization by webview. https://developer.github.com/v3/oauth/ It will be more complicate and the Alcatraz app should add a function to open a WebView (I guess)