Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically get the title of Microsoft knowledge base article by KB number?

I'm trying to develop a C# program that would get a list of available Windows Updates and look up KB articles to retrieve titles of each update. (Otherwise, they all look like cryptic "Update for Windows Server (KBxxxxx)")

I tried retrieving the HTML of each KB article but the title is not present in the HTML (I'm guessing they're using angular to build the page)

Here's an example: https://support.microsoft.com/en-us/kb/3102429 The title of the article as shown in the browser does not appear anywhere in the HTML when I view source

Is there a good way to do this?

like image 979
Igorek Avatar asked Jun 18 '16 02:06

Igorek


1 Answers

For hotfixes released after August 2017, the new API link appears to be https://support.microsoft.com/app/content/api/content/help/en-us/4034733.

For hotfixes released after February 2017, the new API link appears to be https://support.microsoft.com/api/content/help/3115489.

The data on that page is JSON: enter image description here

If you load that JSON data using Python, e.g., then you can find the title and other useful information under "details". In particular,

d["details"]["id"] == u'3115489'
d["details"]["title"] == u'February 7, 2017, update for Office 2013 (KB3115489)'
d["details"]["publishedOn"] == u'2017-02-07T17:05:19.000368Z'

Just for reference, when loading the URL https://support.microsoft.com/kb/3115489 in Chrome with Developer Tools running, the network activity shows an XHR transfer from api/content/help:

enter image description here

like image 138
b.mcewan Avatar answered Sep 28 '22 21:09

b.mcewan