Updated external content (Jenkins build 1779)
parent
57be90d17d
commit
c31c4a71bb
File diff suppressed because one or more lines are too long
|
@ -1,78 +0,0 @@
|
|||
---
|
||||
id: twitter
|
||||
label: Twitter
|
||||
title: Twitter - Bindings
|
||||
type: binding
|
||||
description: "The Twitter binding allows your home to Tweet 280 characters at a time. It also supports direct messages and tweeting with media."
|
||||
since: 3x
|
||||
logo: images/addons/twitter.png
|
||||
install: auto
|
||||
---
|
||||
|
||||
<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->
|
||||
|
||||
{% include base.html %}
|
||||
|
||||
# Twitter Binding
|
||||
|
||||
The Twitter binding allows your home to Tweet 280 characters at a time. It also supports direct messages and tweeting with media.
|
||||
|
||||
## Supported Things
|
||||
|
||||
```text
|
||||
account - Twitter Account.
|
||||
```
|
||||
|
||||
## Thing Configuration
|
||||
|
||||
The Twitter Account Thing requires you to create a Twitter App in the Twitter Developer Page.
|
||||
|
||||
| Property | Default | Required | Description |
|
||||
|-------------------|---------|:--------:|-----------------------------------|
|
||||
| consumerKey | | Yes | Consumer API Key |
|
||||
| consumerSecret | | Yes | Consumer API Secret |
|
||||
| accessToken | | Yes | Access Token |
|
||||
| accessTokenSecret | | Yes | Access Token Secret |
|
||||
| refresh | 30 | No | Tweet refresh interval in minutes |
|
||||
|
||||
## Channels
|
||||
|
||||
| channel | type | description |
|
||||
|------------|--------|------------------------------------------------|
|
||||
| lasttweet | String | This channel provides the Latest Tweet message |
|
||||
|
||||
## Full Example
|
||||
|
||||
twitter.things:
|
||||
|
||||
```java
|
||||
Thing twitter:account:sampleaccount [ consumerKey="11111", consumerSecret="22222", accessToken="33333", accessTokenSecret="444444" ]
|
||||
|
||||
```
|
||||
|
||||
twitter.items:
|
||||
|
||||
```java
|
||||
String sample_tweet "Latest Tweet: [%s]" { channel="twitter:account:sampleaccount:lasttweet" }
|
||||
|
||||
```
|
||||
|
||||
## Rule Action
|
||||
|
||||
This binding includes rule actions for sending tweets and direct messages.
|
||||
|
||||
- `boolean success = sendTweet(String text)`
|
||||
- `boolean success = sendTweetWithAttachment(String text, String URL)`
|
||||
- `boolean success = sendDirectMessage(String recipientID, String text)`
|
||||
|
||||
Examples:
|
||||
|
||||
```java
|
||||
val tweetActions = getActions("twitter","twitter:account:sampleaccount")
|
||||
val success = tweetActions.sendTweet("This is A Tweet")
|
||||
val success2 = tweetActions.sendTweetWithAttachment("This is A Tweet with a Pic", file:///tmp/201601011031.jpg)
|
||||
val success3 = tweetActions.sendTweetWithAttachment("Windows Picture", "D:\\Test.png" )
|
||||
val success4 = tweetActions.sendTweetWithAttachment("HTTP Picture", "http://www.mywebsite.com/Test.png" )
|
||||
val success5 = tweetActions.sendDirectMessage("1234567", "Wake Up" )
|
||||
|
||||
```
|
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
id: x
|
||||
label: X
|
||||
title: X - Bindings
|
||||
type: binding
|
||||
description: "The X (formerly known as Twitter) binding allows your home to post 280 characters at a time. It also supports direct messages and posting with media."
|
||||
since: 3x
|
||||
install: auto
|
||||
---
|
||||
|
||||
<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->
|
||||
|
||||
{% include base.html %}
|
||||
|
||||
# X Binding
|
||||
|
||||
The X (formerly known as Twitter) binding allows your home to post 280 characters at a time. It also supports direct messages and posting with media.
|
||||
|
||||
## Supported Things
|
||||
|
||||
```text
|
||||
account - X Account.
|
||||
```
|
||||
|
||||
## Thing Configuration
|
||||
|
||||
The X Account Thing requires you to create a X App in the X Developer Page.
|
||||
|
||||
| Property | Default | Required | Description |
|
||||
|-------------------|---------|:--------:|-----------------------------------|
|
||||
| consumerKey | | Yes | Consumer API Key |
|
||||
| consumerSecret | | Yes | Consumer API Secret |
|
||||
| accessToken | | Yes | Access Token |
|
||||
| accessTokenSecret | | Yes | Access Token Secret |
|
||||
| refresh | 30 | No | Post refresh interval in minutes |
|
||||
|
||||
## Channels
|
||||
|
||||
| channel | type | description |
|
||||
|----------|--------|-----------------------------------------------|
|
||||
| lastpost | String | This channel provides the Latest post message |
|
||||
|
||||
## Full Example
|
||||
|
||||
x.things:
|
||||
|
||||
```java
|
||||
Thing x:account:sampleaccount [ consumerKey="11111", consumerSecret="22222", accessToken="33333", accessTokenSecret="444444" ]
|
||||
```
|
||||
|
||||
x.items:
|
||||
|
||||
```java
|
||||
String sample_post "Latest post: [%s]" { channel="x:account:sampleaccount:lastpost" }
|
||||
```
|
||||
|
||||
## Rule Action
|
||||
|
||||
This binding includes rule actions for sending posts and direct messages.
|
||||
|
||||
- `boolean success = sendPost(String text)`
|
||||
- `boolean success = sendPostWithAttachment(String text, String URL)`
|
||||
- `boolean success = sendDirectMessage(String recipientID, String text)`
|
||||
|
||||
Examples:
|
||||
|
||||
```java
|
||||
val postActions = getActions("x","x:account:sampleaccount")
|
||||
val success = postActions.sendPost("This is A Post")
|
||||
val success2 = postActions.sendPostWithAttachment("This is A Post with a Pic", file:///tmp/201601011031.jpg)
|
||||
val success3 = postActions.sendPostWithAttachment("Windows Picture", "D:\\Test.png" )
|
||||
val success4 = postActions.sendPostWithAttachment("HTTP Picture", "http://www.mywebsite.com/Test.png" )
|
||||
val success5 = postActions.sendDirectMessage("1234567", "Wake Up" )
|
||||
```
|
|
@ -1,15 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<thing:thing-descriptions bindingId="twitter"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<thing:thing-descriptions bindingId="x" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
|
||||
<thing-type id="account">
|
||||
<label>Twitter Account</label>
|
||||
<description>Account uses for sending Tweets</description>
|
||||
<label>X Account</label>
|
||||
<description>Account uses for sending posts</description>
|
||||
|
||||
<channels>
|
||||
<channel id="lasttweet" typeId="lasttweet"/>
|
||||
<channel id="lastpost" typeId="lastpost"/>
|
||||
</channels>
|
||||
|
||||
<config-description>
|
||||
|
@ -38,10 +37,10 @@
|
|||
|
||||
</thing-type>
|
||||
|
||||
<channel-type id="lasttweet">
|
||||
<channel-type id="lastpost">
|
||||
<item-type>String</item-type>
|
||||
<label>Last Tweet</label>
|
||||
<description>Users Last Tweet</description>
|
||||
<label>Last Post</label>
|
||||
<description>Users Last Post</description>
|
||||
<state readOnly="true"/>
|
||||
</channel-type>
|
||||
</thing:thing-descriptions>
|
Loading…
Reference in New Issue