https://github.com/birkhofflee/blizzard_forum.js

An unofficial Node.js API for Blizzard Forums. (works in 2019)

https://github.com/birkhofflee/blizzard_forum.js

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

api crawler web
Last synced: 5 months ago · JSON representation

Repository

An unofficial Node.js API for Blizzard Forums. (works in 2019)

Basic Info
  • Host: GitHub
  • Owner: BirkhoffLee
  • License: mit
  • Language: JavaScript
  • Default Branch: master
  • Homepage:
  • Size: 38.1 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
api crawler web
Created about 9 years ago · Last pushed almost 6 years ago
Metadata Files
Readme Contributing License

README.md

NPM version Dependencies Build Status Coverage Status

An unofficial Node.js API for Blizzard (Battle.net) Forums.

Attention

Blizzard has recently updated how their forum works, the tests on this project is no longer passing. If you'd like to contribute, you're welcome to open a pull request.

Try Now

Run a sample online to see how this API works.

Installation

Simply download & save it to your package.json with:

$ npm install --save blizzard_forum

Load it with:

js import blizzardForum from "blizzard_forum" let blizForum = new blizzardForum()

That's it. And you may want to set the host and region, which are set to https://us.battle.net and en by default:

```js // https://tw.battle.net/forums/zh

blizForum.set("server.host", "https://tw.battle.net") blizForum.set("server.region", "zh") ```

Contribute & Development

See CONTRIBUTING.md.

Features

Functionalities of this API.

query()

Returns an object of functions.

Initalizes an query expression.

js blizForum.query()

topic(forumname, topicid(, onError))

Returns an array of functions.

This loads a topic with URL https://us.battle.net/forums/en/forum_name/topic/topic_id.

Let's say we're loading this topic: https://us.battle.net/forums/en/bnet/topic/13815891462, thus we should run:

js .query().topic("bnet", 13815891462)

onError is a function which handles the error during the loading process. It takes 1 argument: error, which contains the error information.

data()

Returns a Promise object.

This loads the topic's information. Attributes available: id, lastPosition, forum, isSticky, isFeatured, isLocked, isHidden, isFrozen, isSpam and pollId.

js .query().topic(...).data().then((data) => { console.log(data.isLocked); });

posts((fields)(, filters))

Returns a Promise object. Loads all posts of a topic.

fields is an array that tells the API what information you want. For example, if you pass ["isBlizzardPost"], the result you get will be something like [{isBlizzardPost: true}, {isBlizzardPost: false}, ...].

filters is a function which tells the API that if you wish a post to be in your result. It takes 1 argument, an object with everything about the post: id, position, info, attributes, create_time, lastEditTime, isBlizzardPost, url and content.

Both arguments are optional.

The example below is to print all URLs (and it will only get the URLs) of the Blizzard-staff posted contents under a topic.

js .query().topic(...).posts(['url'], (post) => { return post.isBlizzardPost }).then((posts) => { posts.forEach(post => { console.log(post.url) }) });

Owner

  • Name: birkhoff
  • Login: BirkhoffLee
  • Kind: user
  • Location: Taipei City, Taiwan

backend, SRE, devops, music

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (1)