duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

DOTA 2 Heroes: "more at" link not always working #2793

Closed edgesince84 closed 8 years ago

edgesince84 commented 8 years ago

When viewing the Queen of Pain IA, the "more at" link in the IA does not link to the directly Queen of Pain overview on dota2.com. It brings you to the general "choose a hero" screen. It links directly to other heros' profiles when viewing their IA and following the "more at" link. Is there anything actionable there? It might just be an issue with dota2.com


IA Page: http://duck.co/ia/view/dota2 Maintainer: @echosa

gaulrobe commented 8 years ago

Looks like individual hero URL is now http://www.dota2.com/hero/Queen_of_Pain/.

No longer heroes in the URL. This should be fixable!

edgesince84 commented 8 years ago

@gaulrobe isn't it weird that other characters pages are working, though? Following this one still works, for example.

gaulrobe commented 8 years ago

@edgesince84 ah yes, that IS weird! Looks like the link for the Queen of Pain is showing up as https://www.dota2.com/hero/Queen_of%20Pain

That encoded space should be an underscore.

gaulrobe commented 8 years ago

From their endpoint:

"queenofpain":{
   "dname":"Queen of Pain",
   "u":"Queen_of_Pain",
   "pa":"int",
   "attribs":{
      "str":{
         "b":16,
         "g":"1.70"
      },
      "int":{
         "b":24,
         "g":"2.50"
      },
      "agi":{
         "b":18,
         "g":"2.00"
      },
      "ms":295,
      "dmg":{
         "min":25,
         "max":33
      },
      "armor":1.52
   },
   "dac":"Ranged",
   "droles":"Carry - Nuker - Escape"
}

Maybe, to make the URL we should use the u field instead of dname here https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/share/spice/dota2/dota2.js#L200

echosa commented 8 years ago

I didn't realize that u field was there. Provided it is consistent across all the heroes (it should be), that's much better than manually using name and changing `to_`, as I did. :+1:

sahildua2305 commented 8 years ago

@edgesince84 @echosa Hey! Please check the quick fix #2817