forked from ebradyjobory/financejs.org
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
420 lines (283 loc) · 16.4 KB
/
index.html
File metadata and controls
420 lines (283 loc) · 16.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Personify.js—A JavaScript library that integrates IBM Watson with Twitter APIs</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrappper">
<div class="sidebar">
<header>
<h3>Personify.js (1.0.2)</h3>
<p>A JavaScript library that integrates IBM Watson with Twitter APIs</p>
<p class="view"><a href="https://github.com/PersonifyJS/personify.js">View Source Code <small>PersonifyJS/personify.js</small></a></p>
<ul>
<li><a href="https://github.com/PersonifyJS/personify.js/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://www.npmjs.com/package/personify">Install <strong>npm</strong></a></li>
<li><a href="https://github.com/PersonifyJS/personify.js">Fork On <strong>GitHub</strong></a></li>
</ul>
<a class="link-header" href="#intro">Introduction</a><br>
<a class="link-header" href="#Installing">Installing</a><br>
<a class="link-header" href="#Usage">Usage</a><br>
<strong><a class="link-child" href="#Requiring">Requiring Personify.js</strong><br>
<strong><a class="link-child" href="#Configuration">Configuration</strong><br>
<strong><a class="link-child" href="#Instantiation">Instantiation</strong><br>
<a class="link-header" href="#Methods">Methods</a><br>
<strong><a class="link-child" href="#userPersonify">userPersonify</strong><br>
<strong><a class="link-child" href="#homePersonify">homePersonify</strong><br>
<strong><a class="link-child" href="#searchPersonify">searchPersonify</strong><br>
<strong><a class="link-child" href="#searchTranslate">searchTranslate</strong><br>
<strong><a class="link-child" href="#userTranslate">userTranslate</strong><br>
<strong><a class="link-child" href="#homeTranslate">homeTranslate</strong><br>
<strong><a class="link-child" href="#streamTranslate">streamTranslate</strong><br>
<a class="PersonifyAPI" href="#Usage">Personify API</a><br>
<strong><a class="link-child" href="#userPersonifyAPI">userPersonifyAPI</strong><br>
<strong><a class="link-child" href="#homePersonifyAPI">homePersonifyAPI</strong><br>
<strong><a class="link-child" href="#searchPersonifyAPI">searchPersonifyAPI</strong><br>
<strong><a class="link-child" href="#searchTranslateAPI">searchTranslateAPI</strong><br>
<strong><a class="link-child" href="#callback">callback</strong><br>
<a class="link-header" href="#Credentials">OAuth Credentials</a><br>
<a class="link-header" href="#Tests">Tests</a><br>
<a class="link-header" href="#Contributing">Contributing</a><br>
<a class="link-header" href="#DevelopmentTeam">Development Team</a><br>
<a class="link-header" href="#examples">Example Applications</a>
<br><br>
</header>
</div>
<div class="main-content">
<section>
<h1>
<a id="welcome-to-github-pages" class="anchor" href="#welcome-to-github-pages" aria-hidden="true"><span class="octicon octicon-link"></span></a>Finance.js
</h1>
<h2 id="intro">Introduction</h2>
<p>A JavaScript based library that allows easy access to IBM Watson features utilizing Twitter data. IBM Watson has some of the most advanced linguistic analytics tools available today. Twitter is one of the world's most popular text-based communication platforms. Leverage the power of both with minimal effort through personify.js.</p>
<p>Our current version implements:
<ul><li>Watson User Modeling service, which extracts cognitive and social characteristics, including Big Five, Values, and Needs, from communications data provided.</li>
<li>Watson Machine Translation service, which converts text input in one language into a desired language for the end user. Translation is available for English, Brazilian Portuguese, Spanish, French and Arabic.</li>
<li>Twitter REST API.</li>
<li>Twitter Streaming API.</li>
</ul>
</p>
<p>This project is <a href="https://github.com/PersonifyJS/personify.js">hosted on GitHub</a>. You can report bugs and discuss features on the <a href="https://github.com/PersonifyJS/personify.js/issues">GitHub issues page</a>. Personify.js is available for use under the <a href="https://github.com/PersonifyJS/personify.js/blob/master/LICENSE.md">MIT software license</a>.
<h2 id="Installing">Installing</h2>
<pre><code>npm install personify --save</code></pre>
<h2 id="Usage">Usage</h2>
<!-- Requiring -->
<h3 id="Requiring">Requiring Personify.js</h3>
<pre><code>var Personify = require('personify');</code></pre>
<!-- Configuration -->
<h3 id="Configuration">Configuration</h3>
<p>For every service you use through Watson, IBM will provide you with a separate set of OAuth credentials. See <a href="#Credentials">below</a> to find out where to get these credentials.</p>
<pre><code>var config = { <br>
// example credentials for Watson Machine Translation service<br>
translateConfig : {<br>
service_url: '...',<br>
service_username: '...',<br>
service_password: '...'<br>
},<br><br>
// example credentials for Watson User Modeling service<br>
personalityConfig : {<br>
service_url: '...',<br>
service_username: '...',<br>
service_password: '...'<br>
},<br><br>
// example credentials for Twitter API<br>
twitterConfig : {<br>
consumer_key: '...',<br>
consumer_secret: '...',<br>
access_token: '...',<br>
access_token_secret: '...'<br>
}<br>
};<code></pre>
<!-- Instantiation -->
<h3 id="Instantiation">Instantiation</h3>
<p>Instantiate a new Personify object and pass in OAth credentials:</p>
<pre><code>var P = new Personify(config);</code></pre>
<!-- Methods -->
<h2 id="Methods">Methods</h2>
<!-- userPersonify -->
<h3 id="userPersonify">userPersonify</h3>
<p>Use Watson to discover personality traits, values and needs for a Twitter user;'@' can be used before a username, but is not required (e.g., '@userName').</p>
<pre><code>var params1 = {<br>
screen_name: 'userName',<br>
count: 100<br>
};<br><br>
P.userPersonify( params1 , function (data, err) {<br>
console.log(data, err);<br>
});<br>
</code></pre>
<!-- homePersonify -->
<h3 id="homePersonify">homePersonify</h3>
<p>Watson provides a personality assessment of the combined input of tweets in a user's home timeline. Includes tweets from friends and accounts the user is following, and their retweets</p>
<pre><code>var params2 = {<br>
count: 100, <br>
exclude_tweets: true<br>
};<br><br>
P.homePersonify( params2, function (data, err) {<br>
console.log(data, err);<br>
});<br>
</code></pre>
<!-- searchPersonify -->
<h3 id="searchPersonify">searchPersonify</h3>
<p>Search Twitter with a (required) keyword. Accepts all of Twitter's optional search parameters and a few additional ones we've created for your convenience.</p>
<pre><code>var params3 = { <br>
q: '#JavaScript', <br>
geoCode: 'San Francisco'<br>
};<br><br>
P.searchPersonify( params3 , function (data, err) {
console.log(data, err);
});<br>
</code></pre>
<!-- searchTranslate -->
<h3 id="searchTranslate">searchTranslate</h3>
<p>Grab a number of Tweets in a specified language and get back both the original text and its translation in another destination language. Most of the search parameters available here are the same as those in our searchTweet method.</p>
<pre><code>var params4 = { <br>
q: 'JavaScript',
fromLanguage: 'ar', // Translate from Arabic<br>
toLanguage: 'en', // to English<br>
outputType: 'text' // Choose from text, json or XML<br>
};<br><br>
P.searchTranslate( params4 , function (data, err) {<br>
console.log(data, err);<br>
});<br>
</code></pre>
<!-- userTranslate -->
<h3 id="userTranslate">userTranslate</h3>
<p>Input a Twitter handle and get back their tweets translated</p>
<pre><code>var params5 = {<br>
screen_name: 'userName',<br>
fromLanguage: 'en',<br>
toLanguage: 'fr',<br>
outputType: 'json'<br>
};<br><br>
P.userTranslate( params5, function(data, err){<br>
console.log(data, err);<br>
});<br>
</code></pre>
<!-- homeTranslate -->
<h3 id="homeTranslate">homeTranslate</h3>
<p>Get tweets from your home timeline and have them translated into another language</p>
<pre><code>var params6 = {<br>
count: 150,<br>
fromLanguage: 'en',<br>
toLanguage: 'fr',<br>
outputType: 'json'<br>
};<br><br>
P.homeTranslate( params6, function(data, err){<br>
console.log(data, err);<br>
});<br>
</code></pre>
<!-- streamTranslate -->
<h3 id="streamTranslate">streamTranslate</h3>
<p>Find tweets talkng about the LHC using Twitter's Streaming API and translate them into another language</p>
<pre><code>var params7 = {<br>
track: 'Large Hadron Collider'<br>
fromLanguage: 'en',<br>
toLanguage: 'fr',<br>
outputType: 'text'<br>
};<br><br>
P.streamTranslate( params7, function(data, err){<br>
console.log(data, err);<br>
});<br>
</code></pre>
<!-- Personify API -->
<h2 id="PersonifyAPI">Personify API</h2>
<!-- userPersonifyAPI -->
<h3 id="userPersonifyAPI">userPersonify</h3>
<pre><code>P.userPersonify( 'input', callback )</code></pre>
<p>'input' is required. Object type is a string representing a Twitter username. Optionally you can include an '@' before the username.</p>
<br><br>
<!-- homePersonifyAPI -->
<h3 id="homePersonifyAPI">homePersonify</h3>
<pre><code>P.homePersonify( [params], callback )</code></pre>
<p>'input' is required. Object type is a string representing a Twitter username. Optionally you can include an '@' before the username.</p>
<br><br>
<!-- homePersonifyAPI -->
<h3 id="homePersonifyAPI">homePersonify</h3>
<pre><code>P.homePersonify( [params], callback )</code></pre>
<p>params key-value pairs are optional, but at least empty object literal brackets are required.</p>
<br><br>
<!-- searchPersonifyAPI -->
<h3 id="searchPersonifyAPI">searchPersonify</h3>
<pre><code>P.searchPersonify( { q: 'input', [additional params] }, callback )</code></pre>
<p>The 'q' key and its associated value, which is a string, are required. The string can be any word you may use to search in Twitter's search bar. Any additional key-value pairs are optional.</p>
<br><br>
<!-- searchTranslateAPI -->
<h3 id="searchTranslateAPI">searchTranslate</h3>
<pre><code>P.searchTranslate( { q: 'input', fromLanguage: 'en', toLanguage: 'fr', outputType: 'json' }, callback )</code></pre>
<p>All key-value pairs inside of the object passed as the first argument are required.</p>
<br><br>
<!-- callback -->
<h3 id="callback">callback</h3>
<pre><code>function (data, err)</code></pre>
<p>data is the parsed data received from IBM Watson. Callback functions are required for all methods.</p>
<br><br>
<!-- OAuth credentials -->
<h2 id="Credentials">OAuth Credentials</h2>
<p>Go here to create a Twitter app and get OAuth credentials (if you haven't already):</p>
<a href="https://dev.twitter.com/apps/new">https://dev.twitter.com/apps/new</a>
<p>In order to use IBM Watson, you need to:</p>
<ul>
<li>Register for an IBM Bluemix account: <a href="http://www-01.ibm.com/software/bluemix/"></a>http://www-01.ibm.com/software/bluemix/</li>
<li>Create an App</li>
<li>Add User Modeling and/ or Machine Translation service(s)</li>
<li>From there, IBM will provide your credentials</li>
</ul>
<!-- tests -->
<h2 id="Tests">Tests</h2>
<p>To make the tests pass you will need to fill out the file: config.js inside the tests folder.</p>
<p>To run the tests:</p>
<pre><code>npm test</code></pre>
<!-- Contributing -->
<h2 id="Contributing">Contributing</h2>
<p>To contribute to this project, please take a look at the guidelines on <a href="https://github.com/PersonifyJS/personify.js/blob/master/CONTRIBUTING.md">GitHub</a></p>
<!-- Development Team -->
<h2 id="DevelopmentTeam">Development Team</h2>
<ul>
<li><a href="http://essam.io">Essam Al Joubori</a></li>
<li><a href="https://github.com/rohanagrawal">Rohan Agrawal</a></li>
<li><a href="https://github.com/philelauria">Phil Elauria</a></li>
</ul>
</section>
</div>
<!--
<p>This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:</p>
<pre><code>$ cd your_repo_root/repo_name
$ git fetch origin
$ git checkout gh-pages
</code></pre>
<p>If you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.</p>
<h3>
<a id="designer-templates" class="anchor" href="#designer-templates" aria-hidden="true"><span class="octicon octicon-link"></span></a>Designer Templates</h3>
<p>We've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.</p>
<h3>
<a id="rather-drive-stick" class="anchor" href="#rather-drive-stick" aria-hidden="true"><span class="octicon octicon-link"></span></a>Rather Drive Stick?</h3>
<p>If you prefer to not use the automatic generator, push a branch named <code>gh-pages</code> to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.</p>
<h3>
<a id="authors-and-contributors" class="anchor" href="#authors-and-contributors" aria-hidden="true"><span class="octicon octicon-link"></span></a>Authors and Contributors</h3>
<p>You can <a href="https://github.com/blog/821" class="user-mention">@mention</a> a GitHub username to generate a link to their profile. The resulting <code><a></code> element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (<a href="https://github.com/defunkt" class="user-mention">@defunkt</a>), PJ Hyett (<a href="https://github.com/pjhyett" class="user-mention">@pjhyett</a>), and Tom Preston-Werner (<a href="https://github.com/mojombo" class="user-mention">@mojombo</a>) founded GitHub.</p>
<h3>
<a id="support-or-contact" class="anchor" href="#support-or-contact" aria-hidden="true"><span class="octicon octicon-link"></span></a>Support or Contact</h3>
<p>Having trouble with Pages? Check out the documentation at <a href="https://help.github.com/pages">https://help.github.com/pages</a> or contact <a href="mailto:support@github.com">support@github.com</a> and we’ll help you sort it out.</p>
</section> -->
<footer>
<!-- <p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p> -->
</footer>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-58451637-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>