You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-39Lines changed: 46 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
12
12
http://www.apache.org/licenses/LICENSE-2.0
13
13
14
14
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
15
-
15
+
16
16
## Pushing the app using Eclipse ##
17
17
18
18
### Step 1: Prerequisites ###
@@ -25,34 +25,23 @@ The source for this app is at GitHub so, you can either download the zip file or
Next, you will need to import the project into [**Eclipse**](https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplersr2). Recommendation is to use the Eclipse IDE for Java EE Developers.
42
42
43
43
There are two ways you can get the source into Eclipse:
44
44
45
-
Option A. Import the Eclipse project by following these instructions:
46
-
1. Start by cloning the repository, as described above
47
-
2. Open Eclipse
48
-
3. Select File->Import
49
-
4. Under the header labeled "General", click "Existing Projects Into Workspace" and click Next
50
-
5. Click "Browse" next to the first text field, and navigate to the cloned repository and find the folder labeled "app" and click ok.
51
-
6. Under Projects you should now see a project called "twitter_influence_analyzer", make sure the checkbox next to the "twitter_influence_analyzer" project is checked and then click Finish
52
-
7. You should now see the "twitter_influence_analyzer" project in your list of projects in Eclipse.
53
-
54
-
-OR-
55
-
56
45
Option B. Import the WAR File
57
46
1. Navigate to https://github.com/ibmjstart/bluemix-java-sample-twitter-influence-app/releases
58
47
2. Click the green button labeled "twitter_influence_analyzer.war" and that will download the WAR file.
@@ -61,6 +50,17 @@ Option B. Import the WAR File
61
50
5. Scroll down to the "Web" section, expand that section and click WAR File then click Next.
62
51
6. Click next and then Finish and the project should be imported into Eclipse
63
52
53
+
-OR-
54
+
55
+
Option A. Import the Eclipse project by following these instructions:
56
+
1. Start by cloning the repository, as described above
57
+
2. Open Eclipse
58
+
3. Select File->Import
59
+
4. Under the header labeled "General", click "Existing Projects Into Workspace" and click Next
60
+
5. Click "Browse" next to the first text field, and navigate to the cloned repository and find the folder labeled "app" and click ok.
61
+
6. Under Projects you should now see a project called "twitter_influence_analyzer", make sure the checkbox next to the "twitter_influence_analyzer" project is checked and then click Finish
62
+
7. You should now see the "twitter_influence_analyzer" project in your list of projects in Eclipse.
63
+
64
64
### Step 3. Acquiring External and Public APIs ###
65
65
66
66
This app uses some external APIs. You need to register the app with Twitter and Klout to get the keys and tokens.
@@ -71,25 +71,21 @@ To access the Twitter API you need the consumer keys and access tokens, so you m
71
71
72
72
[More information on how to register the app with Twitter](registerTwitter.md)
73
73
74
-
#### • Klout API ####
75
-
76
-
You can register the app with Klout [here](http://developer.klout.com/member/). When you register with Klout, you'll get a Klout Key, which you can use to create a Klout Object as shown in the code.
77
-
78
74
#### • Google Maps v3 API ####
79
75
80
76
This app uses the Google Maps v3 APIs. Google APIs are open for the developers and you do not need to register the app with Google. Here's the [link](https://developers.google.com/maps/documentation/javascript/tutorial) for the Google Maps APIs.
81
77
82
78
83
79
### Step 4. Configuring the Project Files###
84
80
85
-
There are two files that need to be edited. You can do this directly in Eclipse or using your favorite text editor.
81
+
Edit the twitter4j.properties file with your API and access token credentials. You can do this directly in Eclipse or using your favorite text editor.
The twitter credentials are entered in the file called `twitter4j.properties`. Simply copy and paste the credentials from your new app on twitter into the appropriate categories in the file. Additionally, the Klout API key is entered in the file called `klout.properties`.
88
+
The twitter credentials are entered in the file called `twitter4j.properties`. Simply copy and paste the credentials from your new app on twitter into the appropriate categories in the file.
93
89
94
90
### Step 5. Deploying the app ###
95
91
@@ -99,29 +95,31 @@ Make sure you are in the Java EE [perspective](http://help.eclipse.org/juno/inde
99
95
100
96
1. In the bottom window section, select the **Servers** tab. (Alternatively, you can click: `Window > Show View > Servers`)
101
97
2. Right-Click inside the Servers panel and select `New > Server`
102
-
3. Select, `Pivotal > Cloud Foundry` and click Next.
103
-
4. Click Manage Cloud, then click Add
104
-
5. Enter: `Bluemix` as the name, and `https://api.ng.bluemix.net` as the URL
105
-
6. Click Finish, then click, OK
106
-
7. Enter your login information for Bluemix in the email and password sections.
107
-
8. From the URL dropdown menu, choose: Bluemix
108
-
9. Click: Validate Account
109
-
10. Click: Finish
98
+
3. Select, `IBM > IBM Bluemix` and click `Next`.
99
+
4. Enter your login information for Bluemix in the email and password sections.
100
+
5. From the URL dropdown menu, choose: `IBM Bluemix`
101
+
6. Hit `Next` and Bluemix will automatically validate your account credentials.
102
+
7. Optional: Select the Organization within your Bluemix account that you would like to deploy to.
103
+
8. Click: Finish
110
104
111
105
#### • Push the app ####
112
106
1. Right-Click on the Bluemix server and click: `Connect` (Optional)
113
107
2. Right-Click on the Bluemix server and select: `Add and Remove...`
114
108
3. Select your Twitter Influence Analyzer project from the window on the left and click: `Add >`
115
109
4. Click: `Finish`
116
-
5. Enter a Name and select: Next
117
-
6. Enter a THE SAME hostname that you used to register with Twitter. (e.g. `https://`**`myTwitterApp`**`.mybluemix.net`)
110
+
5. Enter a Name for your app and select: `Next`
111
+
6. Enter THE SAME subdomain that you used to register with Twitter. (e.g. `https://`**`myTwitterApp`**`.mybluemix.net`)
118
112
7. Click: Finish
119
113
120
114
**CONGRATS!** Your app is now published to Bluemix.
121
115
(Note: It can take a few minutes to upload everything and deploy all of the services.)
122
116
123
117
### Step 6. Create a Cloudant service ###
124
118
119
+
There are two ways to create and bind the cloudant service to your application.
120
+
121
+
Option A. Using the ACE UI:
122
+
125
123
1. In your web browser, go to: [https://ace.ng.bluemix.net](https://ace.ng.bluemix.net)
126
124
2. Login and scroll down to the **Services** section
127
125
3. Click: `Add a service`
@@ -130,6 +128,15 @@ Make sure you are in the Java EE [perspective](http://help.eclipse.org/juno/inde
130
128
6. From the drop down menu, select your new app.
131
129
7. Click: `Create`
132
130
131
+
Option B. Using the Eclipse plugin for Bluemix
132
+
1. Double click your application under the IBM Bluemix server.
133
+
2. Under the services selection, select the "add a service icon" in the top right.
134
+
3. Search for cloudantNoSQLDB, and select the first option. Give it a name and pick the shared plan.
135
+

136
+
4. Select `Finish`. This will create the service in your Bluemix organization.
137
+
5. Under services, where your new service (with the name you specified) shows, drag the new service to "Application Services" on the right side of Eclipse. (Verify that you have the right application with the application name.)
138
+
6. Click `Update and Restart` to restart your app with the new service.
139
+
133
140
### Step 7. Explore your app ####
134
141
135
142
1. Navigate to the main dashboard view in Bluemix
@@ -140,12 +147,12 @@ Make sure you are in the Java EE [perspective](http://help.eclipse.org/juno/inde
140
147
141
148
This is the home screen of the app. You can enter a twitter screen name in the text box and click the Analyze button to see their influence. You can also view any records saved in the database by clicking on the 'View Database' button.
142
149
143
-

150
+

144
151
145
152
After entering the twitter name and clicking the Analyze button, you'll be able to see the influence analysis of that person on the left side. You will also see their last 10 tweets and any recent mentions in the tweets plotted on Google Maps (if there is geolocation data for a tweet).
146
153
147
-

154
+

148
155
149
156
These are the records of the Influencers in the database. The user can also delete the records.
0 commit comments