README.md in omnicontacts-0.3.7 vs README.md in omnicontacts-0.3.10

- old
+ new

@@ -30,13 +30,14 @@ ```ruby require "omnicontacts" Rails.application.middleware.use OmniContacts::Builder do importer :gmail, "client_id", "client_secret", {:redirect_path => "/oauth2callback", :ssl_ca_file => "/etc/ssl/certs/curl-ca-bundle.crt"} - importer :yahoo, "consumer_id", "consumer_secret", {:callback_path => '/callback'} + importer :yahoo, "consumer_id", "consumer_secret", {:callback_path => "/callback"} importer :linkedin, "consumer_id", "consumer_secret", {:redirect_path => "/oauth2callback", :state => '<long_unique_string_value>'} importer :hotmail, "client_id", "client_secret" + importer :outlook, "app_id", "app_secret" importer :facebook, "client_id", "client_secret" end ``` @@ -47,21 +48,24 @@ ## Register your application * For Gmail : [Google API Console](https://code.google.com/apis/console/) -* For Yahoo : [Yahoo Developer Network](https://developer.apps.yahoo.com/projects) +* For Yahoo : [Yahoo Developer Network](https://developer.yahoo.com/social/contacts/) * For Hotmail : [Microsoft Developer Network](https://account.live.com/developers/applications/index) +* For Outlook : [Microsoft Application Registration Portal](https://apps.dev.microsoft.com/) + * For Facebook : [Facebook Developers](https://developers.facebook.com/apps) -* For Linkedin : [Linkedin Developer Network](https://www.linkedin.com/secure/developer) +* For Linkedin : [Linkedin Developer Network](https://www.linkedin.com/secure/developer) ##### Note: -Please go through [MSDN](http://msdn.microsoft.com/en-us/library/cc287659.aspx) if above Hotmail link will not work. +Please go through [MSDN](http://msdn.microsoft.com/en-us/library/cc287659.aspx) if above Hotmail link will not work. +Outlook is a newer Microsoft API which allows to retrieve real email address instead of `email_hashes` when using Hotmail, it also works with all kinds of MS accounts (Office 365, Hotmail.com, Live.com, MSN.com, Outlook.com, and Passport.com). ## Integrating with your Application To use the Gem you first need to redirect your users to `/contacts/:importer`, where `:importer` can be facebook, gmail, yahoo or hotmail. No changes to `config/routes.rb` are needed for this step since OmniContacts will be listening on that path and redirect the user to the email provider's website in order to authorize your app to access his contact list. @@ -170,27 +174,46 @@ <td>X</td> <td>X</td> <td></td> </tr> <tr> - <td>Linkedin</td> + <td>Outlook</td> + <td>X</td> + <td>X</td> <td></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> + <td></td> <td>X</td> + <td>X</td> + <td>X</td> + <td>X</td> <td></td> + <td>X</td> <td></td> <td></td> + </tr> + <tr> + <td>Linkedin</td> <td></td> + <td>X</td> + <td>X</td> + <td>X</td> + <td>X</td> + <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> + <td></td> + <td></td> + <td></td> + <td></td> <tr> </table> Obviously it may happen that some fields are blank even if supported by the provider in the case that the contact did not provide any information about them. @@ -212,11 +235,11 @@ ## Tips and tricks OmniContacts supports OAuth 1.0 and OAuth 2.0 token refresh, but for both it needs to persist data between requests. OmniContacts stores access tokens in the session. If you hit the 4KB cookie storage limit you better opt for the Memcache or the Active Record storage. -Gmail requires you to register the redirect_path on their website along with your application. Make sure to use the same value present in the configuration file, or `/contacts/gmail/callback` if using the default. +Gmail requires you to register the redirect_path on their website along with your application. Make sure to use the same value present in the configuration file, or `/contacts/gmail/callback` if using the default. Also make sure that your full url is used including "www" if your site redirects from the root domain. To configure the max number of contacts to download from Gmail, just add a max results parameter in your initializer: ```ruby importer :gmail, "xxx", "yyy", :max_results => 1000 @@ -243,9 +266,14 @@ ```ruby OmniContacts.integration_test.mock(:provider_name, :email => "user@example.com") ``` You can either pass a single hash or an array of hashes. If you pass a string, an error will be triggered with subsequent redirect to `/contacts/failure?error_message=internal_error` + +You can also pass a user to fill `omnicontacts.user` (optional) +```ruby + OmniContacts.integration_test.mock(:provider_name, {:email => "contact@example.com"}, {:email => "user@example.com"}) +``` Follows a full example of an integration test: ```ruby OmniContacts.integration_test.enabled = true