Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

removed auth keys & secret keys from examples #245

Closed
wants to merge 1 commit into from

2 participants

@philihp

Hi,

I noticed there were some app IDs and secret keys in some examples, while other examples told the user to replace them. fixed this so it's "you should replace this" in all of them.

@fernandezpablo85

Though I like consistency, I think the whole "get something working out of the box" is useful. Perhaps there's a way to get the best of both worlds?

@philihp

I understand, I like that too, but I worry that a lazy or naive developer will just use your keys without understanding the implications of doing so. Some of the examples (such as the Facebook example) lack API keys, shall I find stub keys for those?

@fernandezpablo85

No, you're into something here. There are some good points:

1) Some examples have a key and others don't, this distinction is arbitrary.

2) Examples are sometimes used (by myself or others) as end-to-end tests, this is not right.

3) Examples are pretty much the same thing, over and over.

@philihp

Perhaps there should be proper test cases (with keys) in one place, and there should be examples (without keys) in another place?

@fernandezpablo85

I was thinking something like that:

1) end-to-end tests

2) Wikipage with one or two examples

@fernandezpablo85

I've always wanted to create some (perhaps ruby-powered) end-to-end tests BTW

@philihp

How does one create ruby-powered tests? That sounds cool (I have always wanted an excuse to learn some Ruby), but I've never seen it done with anything other than JUnit.

@fernandezpablo85

I was thinking about some automation tool like watir for example. I do need to take some time off and draft something like that though. If you want to give it a look yourself, that would be super awesome :)

I'm open to ideas here, it doesn't need to be ruby at all.

@philihp

Oh man, yeah, doing this in JUnit is annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2012
  1. @philihp

    removed api keys & secret keys from examples, replaced with something…

    philihp authored
    … user should obviously change
This page is out of date. Refresh to see the latest.
View
4 src/test/java/org/scribe/examples/Foursquare2Example.java
@@ -15,8 +15,8 @@
public static void main(String[] args)
{
// Replace these with your own api key and secret
- String apiKey = "FEGFXJUFANVVDHVSNUAMUKTTXCP1AJQD53E33XKJ44YP1S4I";
- String apiSecret = "AYWKUL5SWPNC0CTQ202QXRUG2NLZYXMRA34ZSDW4AUYBG2RC";
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(Foursquare2Api.class)
.apiKey(apiKey)
View
7 src/test/java/org/scribe/examples/FoursquareExample.java
@@ -13,10 +13,13 @@
public static void main(String[] args)
{
+ // Replace these with your own api key and secret
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(FoursquareApi.class)
- .apiKey("FEGFXJUFANVVDHVSNUAMUKTTXCP1AJQD53E33XKJ44YP1S4I")
- .apiSecret("AYWKUL5SWPNC0CTQ202QXRUG2NLZYXMRA34ZSDW4AUYBG2RC")
+ .apiKey(apiKey)
+ .apiSecret(apiSecret)
.build();
Scanner in = new Scanner(System.in);
View
7 src/test/java/org/scribe/examples/LinkedInExample.java
@@ -13,10 +13,13 @@
public static void main(String[] args)
{
+ // Replace these with your own api key and secret
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(LinkedInApi.class)
- .apiKey("CiEgwWDkA5BFpNrc0RfGyVuSlOh4tig5kOTZ9q97qcXNrFl7zqk-Ts7DqRGaKDCV")
- .apiSecret("dhho4dfoCmiQXrkw4yslork5XWLFnPSuMR-8gscPVjY4jqFFHPYWJKgpFl4uLTM6")
+ .apiKey(apiKey)
+ .apiSecret(apiSecret)
.build();
Scanner in = new Scanner(System.in);
View
7 src/test/java/org/scribe/examples/MeetupExample.java
@@ -17,10 +17,13 @@
public static void main(String[] args)
{
+ // Replace these with your own api key and secret
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(MeetupApi.class)
- .apiKey("j1khkp0dus323ftve0sdcv6ffe")
- .apiSecret("6s6gt6q59gvfjtsvgcmht62gq4")
+ .apiKey(apiKey)
+ .apiSecret(apiSecret)
.build();
Scanner in = new Scanner(System.in);
View
4 src/test/java/org/scribe/examples/SinaWeibo2Example.java
@@ -15,8 +15,8 @@
public static void main(String[] args)
{
// Replace these with your own api key and secret
- String apiKey = "342348223";
- String apiSecret = "cfdf672e166a4bc954c0e33f03cf0d1b";
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(SinaWeiboApi20.class)
.apiKey(apiKey)
View
7 src/test/java/org/scribe/examples/TwitterExample.java
@@ -13,10 +13,13 @@
public static void main(String[] args)
{
+ // Replace these with your own api key and secret
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(TwitterApi.class)
- .apiKey("6icbcAXyZx67r8uTAUM5Qw")
- .apiSecret("SCCAdUUc6LXxiazxH3N0QfpNUvlUy84mZ2XZKiv39s")
+ .apiKey(apiKey)
+ .apiSecret(apiSecret)
.build();
Scanner in = new Scanner(System.in);
View
7 src/test/java/org/scribe/examples/YahooExample.java
@@ -13,10 +13,13 @@
public static void main(String[] args)
{
+ // Replace these with your own api key and secret
+ String apiKey = "your_app_id";
+ String apiSecret = "your_api_secret";
OAuthService service = new ServiceBuilder()
.provider(YahooApi.class)
- .apiKey("dj0yJmk9TXZDWVpNVVdGaVFmJmQ9WVdrOWMweHZXbkZLTkhVbWNHbzlNVEl5TWprd05qUTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0wMw--")
- .apiSecret("262be559f92a2be20c4c039419018f2b48cdfce9")
+ .apiKey(apiKey)
+ .apiSecret(apiSecret)
.build();
Scanner in = new Scanner(System.in);
Something went wrong with that request. Please try again.