Forum Discussion

mpotterf's avatar
11 years ago

Lithium API - How do we get the Keywords that are posted in our topics via the API?

How does I obtain the keywords in each topics keyword metadata via the API? These keywords are located in the header of every topics page. I'm not looking to get the tags for each message; the tags don't seem to have anything to do with the keywords that are published in these pages.

 

Sample Topic URL: 

http://forums.autodesk.com/t5/DWG-TrueView/Where-do-I-find-NET-4-0-SP1-for-TrueView-2013/m-p/3389243#M17975

 

Desired API string response: "2012, 2013, 2014, DWG, DWG TrueView, error, install, true view, TrueView, Trueview 2013"


Screen Shot 2014-07-03 at 1.14.43 PM.png
  • Hi mpotterf - The metadata is a generic feature which is not native to Lithium APIs. There is no REST API to fetch these details. You can try fetching the Meta keywords via javascript.

     

    var keywords = $('meta[name=keywords]').attr("content");
    console.log(keywords);
    
    Will output:
    
    2012, 2013, 2014,  DWG, DWG TrueView, error, install, true view, TrueView, Trueview 2013

     I hope this helps

    • DougS's avatar
      DougS
      Khoros Oracle

      Your best bet is probably going to be to use JavaScript (like the jquery that GrazittiI mentions in his reply).  I believe the server-side logic to determine what to populate in the keywords element works like this:

       

      1.)    If board.keywords setting set at the board level, use that (you can set this in the admin by clicking on the board from the "community structure" tab, clicking "edit properties" and filling in the "keywords" field)

      2.)    Else if category.keywords setting set at the category level, use that (you can set this in the admin by clicking on the category from the "community structure" tab, clicking "edit properties" and filling in the "keywords" field)

      3.)    Else if community.keywords setting set at the community level, use that  (you can set this in the admin but clicking on the community from the "community structure" tab, clicking "edit properties" and filling in the "community keywords" field)

      4.)    Else use tags (if this is a message or thread page)

      5.)    Else use tags (by walking up the node chain)

       

      -Doug

      • mpotterf's avatar
        mpotterf
        Guide

         

        Doug, 

         

        Thanks for your time and the detailed response you provided. 

         

        I looked into a random topic on our site and have provided my findings below. I noticed that 4 of the words (error, hatch, pdf, Spaces, window) don't appear on the page at all yet are included in the meta data keywords.

         

        Also, ACA an acronym for AutoCAD Architecture appears under the reccomendations component but does not appear in the topic. This leads me to believe that a) the meta keywords for the page are being influenced by the components on the right or b) there is inteligant logic in Lithium core that has dtermined that ACA is an acronym for AutoCAD Architecture.

         

        1.) 0 keywords

        2.) 0 keywords

        3.) 0 keywords

        4.) 0 tags

        5.) ?

         

        The topic I used was http://forums.autodesk.com/t5/AutoCAD-Architecture-General/How-to-do-Publishing-in-2014/m-p/512166. Attached are the screenshots from the Community, Category and Board properties. 

         

        Structural Location: Autodesk Community > AutoCAD Architecture > AutoCAD Architecture General > How to do Publishing in 2014

        Meta Data&colon; <metaname="keywords"content="2012, ACA, architecture, autocad, Autocad Architecture, error, hatch, pdf, Spaces, windowā€¯/> 

         

        Could you explain what you mean by "walking up the node structure?"

        Would it be possible to access the recommendations commponent links via the API? If we sent the API a topic ID could we get recieve five related IDs? 

         

         


        AutoCAD Archecture General Properties.pngAutoCAD Architecture Properties.pngCommunity Properties.pngTopic - Meta Data.png