How to successfully call JET.news.createTopNews?
I can't get a successful return by calling JET.news.createTopNews, after going through the jet help doc. Could someone please provide an workable example? Thanks.
Tagged:
0
Answers
-
I can make it work. I subscribed to all URN IDs mentioned in
https://thehub.thomsonreuters.com/docs/DOC-559026?utm_medium=search&utm_source=full. However, the update is fired infrequently. The following is a javacript code. You need to try to add all URNs in the excel sheet to topnewsid variable. var subscription; var topnewsid = [ "urn:newsml:
reuters.com:20020923:SPDOC_119827232002", "urn:newsml:
reuters.com:20020924:SPDOC_55977242002", "urn:newsml:
reuters.com:20020924:SPDOC_55994242002", ... ...] JET.onLoad(function () { console.log("JET is Ready"); // Creates a new subscription subscription = JET.News.createTopNews() // Sets necessary ids. You can also pass an array of string to the "ids" method .ids(topnewsid) // Sets update handler. Two values are passed to the callback: // id of the top news, and top news version number .onUpdate(function (id, ver) { console.log("onupdate: " + id + "; ver = " + ver); }) // Start the subscription .start(); console.log("Start Subscription"); }); window.onload = function () { JET.init({ ID: "WebPageID", Title: "My Web Page", Summary: "A sample page for the JET API" }); } The following is an output from chorme console: JET is Ready newsapp.js:55 Start Subscription newsapp.js:71 onupdate: urn:newsml:
reuters.com:20020924:SPDOC_56007242002; ver = 105366 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20030314:SPDOC_75426142003; ver = 71902 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20020924:SPDOC_55977242002; ver = 184701 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20020924:SPDOC_55977242002; ver = 184702 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20110405:SPDOC_1577840520111; ver = 20546 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20020923:SPDOC_119827232002; ver = 367680 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20020924:SPDOC_55977242002; ver = 184703 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20020924:SPDOC_55994242002; ver = 100628 newsapp.js:66 onupdate: urn:newsml:
reuters.com:20110214:SPDOC_1568591420111; ver = 27780 newsapp.js:660
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛