Adding social sharing
With the ever-increasing demand to integrate social media into your apps, you'll want to gain a basic understanding of how to send/post/share directly from within your app. This recipe will show you how to add Twitter posting (tweets) to your application.
Getting ready
We will be using the Quotes application, from the Creating a complete app with Iron Router recipe found earlier in this in this chapter. Please complete that recipe before proceeding.
We will also be using the npm
twit
module to complete this recipe. For a step-by-step recipe with a full explanation of each step, please see the first part of the Handling asynchronous events recipe in Chapter 11, Leveraging Advanced Features.
Quickly, here are the steps you'll need to install and configure the twit
module:
Execute the following terminal commands:
$ meteor add meteorhacks:npm $ meteor
Open
packages.json
and add the following code:{ "twit" : "1.1.20" }
Run the following terminal command:
$ meteor
Create
[project...