Coder Social home page Coder Social logo

Publishing as gist about rcharts HOT 10 CLOSED

ramnathv avatar ramnathv commented on September 26, 2024
Publishing as gist

from rcharts.

Comments (10)

ramnathv avatar ramnathv commented on September 26, 2024

Here is some info from the ruby implementation jist. So one way I can handle this situation is to do the following the first time get_token is run.

  1. ask user for username and password.
  2. use it to fetch a token for the gist scope.
  3. save the token in ~/.rCharts
  4. print a message to the user about the save and how to revoke access

The only thing left to think is (3), a location to save the token. Maybe .Rprofile? I need to brush up a bit on how R starts up.


If you want to associate your gists with your github account, you need to login
with jist. It doesn't store your username and password, it just uses them to get
an OAuth2 token (with the "gist" permission).

jist --login
Obtaining OAuth2 access_token from github.
Github username: ConradIrwin
Github password:
Success! https://github.com/settings/applications

This token is stored in ~/.jist and used for all future gisting. If you need to
you can revoke it from https://github.com/settings/applications, or just delete the
file.

After you've done this, you can still upload gists anonymously with -a.


from rcharts.

ramnathv avatar ramnathv commented on September 26, 2024

Another location where the token could be saved is the package directory (which most likely the user has write access to). The one advantage with this approach is cross-platform support. The disadvantage is that the token gets overwritten when a new version of the package is installed.

from rcharts.

ramnathv avatar ramnathv commented on September 26, 2024

While I am on this, I should add the ability to publish anonymously too. It could be a simple flag to the publish function that can do the trick

  • add ability to publish gist anonymously.
  • save token generated and use it across sessions.

from rcharts.

timelyportfolio avatar timelyportfolio commented on September 26, 2024

think it is something wrong with my local instance, but I'm now getting Error: Forbidden when I try to publish to gist. Any ideas?

from rcharts.

ramnathv avatar ramnathv commented on September 26, 2024

Try setting your username and password using

options(github.user = 'username', 'github.password' = 'password')

and try. I will be rewriting the publish function to make use of basic authorization rather than OAuth, which is the case currently. Basic authorization is easier as it only requires a username and password and no token fetching, which is how the publish function works currently.

from rcharts.

timelyportfolio avatar timelyportfolio commented on September 26, 2024

still does not work. The error comes in the get_token() function. Any way to delete the token?

from rcharts.

ramnathv avatar ramnathv commented on September 26, 2024

I am getting an error too. Just trying get_token(username, password) is giving me an error. Let me see if I can push basic authorization quickly.

from rcharts.

ramnathv avatar ramnathv commented on September 26, 2024

Just pushed to github replacing oauth with basic auth. Try again and let me know if it works.

from rcharts.

timelyportfolio avatar timelyportfolio commented on September 26, 2024

works great as shown and closed in #42

from rcharts.

ramnathv avatar ramnathv commented on September 26, 2024

Using basic auth solves the issue for now, since no more token issuing occurs. There is still the problem of using readline for getting username and password, but that should be easy to fix since the options alternative always exists.

from rcharts.

Related Issues (20)

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.