Title: Brickset API
Author: NateJacobs
Published: <strong>2013 年 3 月 23 日</strong>
Last modified: 2014 年 12 月 26 日

---

搜尋外掛

![](https://ps.w.org/brickset-api/assets/banner-772x250.png?rev=686133)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/brickset-api_4b6aa1.svg)

# Brickset API

 由 [NateJacobs](https://profiles.wordpress.org/natejacobs/) 開發

[下載](https://downloads.wordpress.org/plugin/brickset-api.1.4.1.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/brickset-api/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/brickset-api/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/brickset-api/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/brickset-api/#developers)

 [技術支援](https://wordpress.org/support/plugin/brickset-api/)

## 外掛說明

This plugin is an implementation of the Brickset Webservice. It includes methods
to get LEGO® set and theme data from Brickset as well as pre-formated methods to
display set data. The set data requested is cached daily to reduce HTTP requests
and page load time. Please visit [Brickset](http://brickset.com/) for more information
on the [webservice](http://www.brickset.com/webservices). You can obtain an API 
key from [Brickset](http://brickset.com/contact/).

The main development is all happening on [GitHub](https://github.com/NateJacobs/Brickset-API).

This is not an official Brickset.com plugin. LEGO® is a trademark of the LEGO Group
of companies which does not sponsor, authorize or endorse this plugin.

#### Oembed

You can paste a Brickset set or theme url into your post or page. Once you publish
the post or page information about the set or theme will be displayed. Two example
URLs are below.

 * Set URL: http://brickset.com/detail/?Set=79003-1
 * Theme URL: http://brickset.com/browse/themes/?theme=The%20Hobbit

#### Template Tags

The plugin has numerous template tags you are able to use in your theme. They are
listed below with a short description.

 * `brickset_themes();` outputs a list of all themes.
 * `brickset_subthemes( $theme );` outputs a table of all subthemes of the theme
   specified, the number of sets, and years available.
 * `brickset_theme_years( $theme );` outputs a table of all the years the specified
   theme was available and the number of sets each year.
 * `brickset_popular_searches();` outputs a list of the most popular search terms
   on Brickset.com.
 * `brickset_updated_since( $date );` outputs a table of the sets updated since 
   the date specified. The table includes thumbnail, set name and set number.
 * `brickset_set_number( $set );` outputs a list of details about the sets specified.
   More than one set can be requested by separating the set numbers with a comma,
   e.g. ‘1380,10240’.

#### Shortcode

The plugin has a shortcode you may use in your posts and pages to display information
about a set or sets.

 * `[bs_set number='XXX']` outputs information about a specific set. Thumbnail, 
   set name, set number, pieces, theme, subtheme and year. You can display multiple
   sets by seperating the set numbers with a comma.

#### Widgets

The plugin has four widgets you can activate in your theme. The first displays a
list of all themes on Brickset with a link to browse each theme on Brickset.com 
and the second to display the details about a specific set. The third allows you
to show off the total count of your minifigs. The last widget displays a count of
sets produced in each year for a given theme.

#### Advanced Use

This example shows how to get the data about a specific set. You can find the developer
docs [here](https://github.com/NateJacobs/Brickset-API/wiki).

 1. Instantiate the class.
 2. $brickset = new BricksetAPISearch();
 3. Pass a set number to the get_by_number method.
 4. $set_data = $brickset->get_by_number( ‘8014’ );
 5. Test for an error
 6. if( is_wp_error( $set_data ) {
     echo $set_data->get_error_message; }
 7. Display the results how you like. This will display the set’s theme.
 8. else {
     echo $set_data->theme; }

### Road Map

 1. Template tags to display sets specific to a user.
 2. Caching of images

You can follow all the open feature requests and enhancements on [GitHub](https://github.com/NateJacobs/Brickset-API/issues?milestone=&page=1&state=open).

## 螢幕擷圖

[⌊Individual Set Display⌉⌊Individual Set Display⌉[

Individual Set Display

[⌊Years theme is available⌉⌊Years theme is available⌉[

Years theme is available

[⌊Sets in space theme⌉⌊Sets in space theme⌉[

Sets in space theme

## 安裝方式

 1. Upload the entire `brickset-api` folder to the `wp-content/plugins/` directory 
    of your WordPress installation or download from the Plugin Repository
 2. Activate the plugin through the Plugins menu in WordPress
 3. Add your Brickset.com API key to the Brickset settings page which can be found 
    as a submenu under the Settings menu
 4. Either add a Brickset link (url) to a set or theme in a post or page, or add a 
    template tag to a theme file, or for advanced use instantiate the class and create
    your own display method.

## 常見問題集

  Can I add sets to my set list on Brickset with this plugin?

Yes you can, but it requires writing custom code using the API functions of the 
plugin.

  Does this plugin require an API Key from Brickset

To display more than twenty sets from a search query an API key is required. You
can obtain one by contacting Brickset on this [page](http://brickset.com/contact/).

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Brickset API〉的開發相關工作。

參與者

 *   [ NateJacobs ](https://profiles.wordpress.org/natejacobs/)

[將〈Brickset API〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/brickset-api)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/brickset-api/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/brickset-api/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/brickset-api/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/brickset-api/)。

## 變更記錄

#### Version 1.4.0

 * New owned minifig widget – display how many minifigs you own
 * New theme years widget – display how many sets were produced for a given theme
   in a given year
 * Introduce filters to enable overwriting the default cache time of 24 hours for
   Brickset data
 * Add third parameter to shortcode functions

#### Version 1.3

 * Add a new widget to display set details
 * Add current_user_can check to user profile settings
 * Administrators can now select which currency (US dollar, CA dollar, UK pound)
   is displayed when using the built in template tags, shortcode and oembed set 
   data
 * Administrators can choose if the Bricklink link is displayed in template tags,
   shortcode and oembed set data

#### Version 1.2

 * Removed anonymous function from class-widgets.php

#### Version 1.1

 * Add ability to update wanted and owned sets
 * Add ability to update the quantity owned of a set
 * Add ability to search a user’s minifig collections
 * Add ability to update wanted and owned minifigs
 * Updated class name – BricksetAPIFunctions became BricksetAPISearch

#### Version 1.0

 * Enter your Brickset API from the settings submenu.
 * Allow users to authenticate with Brickset from their profile page.
 * Refactor code base
 * Add localization and translation .po
 * Create webservice-definition.json to display details about the availble calls
 * Brickset oembed support for set and theme URLs

#### Version 0.3

 * Added get_owned function and shortcode.

#### Version 0.2

 * Get_set and my_wanted shortcodes added.
 * BricksetAPIFunctions updated to use wp_remote_get.
 * Added template tags for use in themes.

#### Version 0.1

 * Initial plugin.

## 中繼資料

 *  版本 **1.4.1**
 *  最後更新 **12 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 3.5 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.1.42**
 *  語言
 * [English (US)](https://wordpress.org/plugins/brickset-api/)
 * 標籤:
 * [brick](https://tw.wordpress.org/plugins/tags/brick/)[lego](https://tw.wordpress.org/plugins/tags/lego/)
 *  [進階檢視](https://tw.wordpress.org/plugins/brickset-api/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/brickset-api/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/brickset-api/reviews/)

## 參與者

 *   [ NateJacobs ](https://profiles.wordpress.org/natejacobs/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/brickset-api/)