Skip to content

Commit a6b1b55

Browse files
author
Wasin Waeosri
committed
change logs:
README.md: format correction trkd_newsheadline.py: change maximum number of items to be fetched from 25 to 10
1 parent 903dc5b commit a6b1b55

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ This is an example project that shows how to implement TRKD HTTP JSON Client wit
1313
- trkd_interday.py: An example application that shows how to subscribe the Interday Time-series data from TRKD service
1414
- trkd_onlinereport.py: An example application that shows how to subscribe the Online Report data from TRKD service
1515
- trkd_chart.py: An example application that shows how to subscribe and download the Chart image data from TRKD service
16-
- docs\TRKD_REST_with_Python.docx: A document that describes the trkd_authen.py and trkd_quote.py applications
16+
- docs\TRKD_REST_with_Python.docx: A document that describes the trkd_authen.py and trkd_quote.py applications
1717

1818

1919
## Prerequisite
2020
The following softwares are required to use this script
2121
- Python 2.7.10 or above
22-
- The [requests](http://docs.python-requests.org/en/master/) library
22+
- The [requests](http://docs.python-requests.org/en/master/) library
2323

2424
The scripts are based on Python 2 but you can modify it to run with Python 3 (see "Optional - How to run with Python 3" section).
2525

@@ -30,7 +30,7 @@ $>python <application>.py
3030
```
3131

3232
## Optional - How to install requests
33-
The best way is via the pip package management tool
33+
The best way is via the pip package management tool
3434
1. export <Python_folder>\Scripts to your OS PATH environment
3535
2. call pip command to install requests
3636
```
@@ -43,22 +43,22 @@ The best way is via the pip package management tool
4343
```
4444
## Optional - How to run with Python 3
4545
You can modify the scripts to run with Python 3 (with requests library installed) by just change the code from "**raw_input()**" to "**input()**" as the following example
46-
- Python 2
47-
```
48-
username = raw_input('Please input username: ')
49-
```
50-
- Python 3
51-
```
52-
username = input('Please input username: ')
53-
```
46+
- Python 2
47+
```
48+
username = raw_input('Please input username: ')
49+
```
50+
- Python 3
51+
```
52+
username = input('Please input username: ')
53+
```
5454

5555
## Release Note
5656
- Version 1: 6 Sep 2016
5757
- trkd_authen.py
5858
- trkd_quote.py
5959
- Version 1.0.1: 7 Sep 2016
6060
- trkd_newsheadline.py
61-
- changed code structure to separate call http request
61+
- changed code structure to separate call http request
6262
- Version 1.0.2: 19 Sep 2016
6363
- trkd_newsstory.py
6464
- version 1.0.3: 22 Sep 2016
@@ -78,4 +78,3 @@ You can modify the scripts to run with Python 3 (with requests library installed
7878
- version 1.0.7: 9 May 2017
7979
- revies README.md
8080
- modify the rest of application files
81-

trkd_newsheadline.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'''
2-
The TRKD API sample code is provided for informational purposes only
3-
and without knowledge or assumptions of the end users development environment.
4-
We offer this code to provide developers practical and useful guidance while developing their own code.
5-
However, we do not offer support and troubleshooting of issues that are related to the use of this code
6-
in a particular environment; it is offered solely as sample code for guidance.
7-
Please see the Thomson Reuters Knowledge Direct product page at http://customers.thomsonreuters.com
2+
The TRKD API sample code is provided for informational purposes only
3+
and without knowledge or assumptions of the end users development environment.
4+
We offer this code to provide developers practical and useful guidance while developing their own code.
5+
However, we do not offer support and troubleshooting of issues that are related to the use of this code
6+
in a particular environment; it is offered solely as sample code for guidance.
7+
Please see the Thomson Reuters Knowledge Direct product page at http://customers.thomsonreuters.com
88
for additional information regarding the TRKD API.'''
99

1010
import os
@@ -47,10 +47,10 @@ def CreateAuthorization(username, password, appid):
4747
print('response status %s'%(authenResult.status_code))
4848
##get Token
4949
token = authenResult.json()['CreateServiceToken_Response_1']['Token']
50-
50+
5151
return token
5252

53-
## Perform News Headline request
53+
## Perform News Headline request
5454
def RetrieveNewsHeadline(token, appid):
5555
##construct news headline URL and header
5656
newsURL = 'https://api.trkd.thomsonreuters.com/api/News/News.svc/REST/News_1/RetrieveHeadlineML_1'
@@ -59,7 +59,7 @@ def RetrieveNewsHeadline(token, appid):
5959
ricName = raw_input('Please input Symbol: ')
6060
newsRequestMsg = {'RetrieveHeadlineML_Request_1': {
6161
'HeadlineMLRequest':{
62-
'MaxCount':25,
62+
'MaxCount':10,
6363
'Filter':[
6464
{
6565
'MetaDataConstraint':{
@@ -96,4 +96,3 @@ def RetrieveNewsHeadline(token, appid):
9696
## if authentiacation success, continue subscribing News Headline
9797
if token is not None:
9898
RetrieveNewsHeadline(token,appid)
99-

0 commit comments

Comments
 (0)