Skip to content

Commit

Permalink
Merge branch 'release/1.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
mick352 committed Aug 29, 2019
2 parents 86ab82a + 082aa78 commit 4f2b576
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: node_js
node_js:
- '8'
- '10'
- '12'
dist: trusty
sudo: required
addons:
Expand Down Expand Up @@ -36,7 +37,7 @@ deploy:
node_js: '8'
- provider: releases
api_key:
secure: "L60l7vyNfWmyEvLhVSY4EKb3Y61Sq0VVBinmZOEIGf4lYPGaFKiOZOgVOiIe9juvB2kJ5meyHkEstdnWaarTAmzufnjW1SO55Q9bF/ZZ2N7l0q2+7Gh57H5Wp+DFwslD8ymOQdI/0xtoOlXkxDCOCwaw2esJpqRxNR2MfEkGis54/uUaahyx6zsXWvzzefpxIB/uZjOFdklqJVxHfvyYDSK8oHAHGbdNaqpf761FyV9tcnGQ2oMSzR+oI9sg8CXQABiGaJKsFjmJF2XuzwG3blCxpk3e8E1aucxsqnd7pq0rloPM+AQgFBhnBh4rtUMmQ1w7hmCRZPXc9bpg08XNbRmd5YOiHuFrF3cvdTQMAjW0jT1H/DlpwteKy4BYn8ucG+H3bxjnjh1M2zjUXuvzrdqJQM+6DdkJ7/x0T4nlcLVCUSKNfOuc7rvCc3HJZ8206yRKItGj9m/hEPFwNic05WLNDwkUwr59RR6qSogycNDL976mgGwqaR1Pi/W7KalcSQjfIT6lxcHYUgQvpmnLs1VAX6xjPy1soDwGK8BZ24ZS3Ou+enYEhzS5svCJrwmWM6ian+CP08YooCIxOdfd2yM+R2yAxeJ+butZQRHmOtrxjg6xdjDcjrdGsgwN2OB3ruRwhAc0ZN6yj85RrvxutMMpx3LDgklwkXd7nVHgZNA="
secure: "pQTUUSHprolW8fE7MerxZBRoxk2HleoYyfwgFZI9ZQ50Tx6jtUKRgwTJc5jckJpgNLu9FVM0D0Z8v037CRk4Wd4UWSSc0OCmR0FKqlhGD1sppRVPRhvayfviCMsTRlUgD3ge2kjpuN+XfGzntem6Jfq69tf3q7/xfMW7RXEga8+KE2l+jB3Bhc8y18rI547jwiDN4n/Dwf2AlndZp+a0ssVklC7sY6IomyoSstpJG6tKDNBgIfIDM0lszd/mjhEzlDaEKqJVF9v00OSFt5p+jqnJAfZfCDiX1w0NFgjwbRMyCYJLmmYLi1ge/KEDQ1b1TAVO4tuMvQAZ/FextJvimqx9cIPzfLXHdjTMh3tBFAK1fNPeoK8+ZMce3TE3H17YDUbUKnQZXW+Dr02bFlXvP3zW0CAOYjhCDsoiVjuUyQF2NcNgvSgDGplp8xu2WrEzRh7DRxuBhfQwe6Y1YIo+TvDy9qj0gxbUf98W+f680drpIf6v/Io7XVTIj2BZZYM9ulZywberCP0XWN4pal/nLQCloEXUZjTBOIBuBdimOBl5IwYBKZX+Km0oMtKtKEcIydn+KxRlyVpbqCI4MNMdnR0hJ0UfYgOeF+K+QGJZwxtgxMw7UQGgxaASYWY37jS+LkECI1+ZYS0cNx6del9eC/24E/EJu9u/neCSSv4YMwI="
file:
- $BASE_NAME.zip
- $BASE_NAME.tar.gz
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# embetty

## v1.1.8, 2019-08-29

- Fix by @leto to adjust to new Twitter API.

## v1.1.7, 2019-06-11

- Upgraded dependencies.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Example:
<script async src="embetty.js"></script>
</head>
<body>
<embetty-tweet status="950371792874557440"></embetty-tweet>
<embetty-tweet status="1166685910030790662"></embetty-tweet>
</body>
</html>
```
Expand Down Expand Up @@ -97,6 +97,14 @@ Example code:
document.querySelector('embetty-tweet').addEventistener('initialized', function(e) { ... })
```
## Testing
1. Clone this repository.
2. `yarn`
3. export the `TWITTER_` tokens mentioned in https://github.com/heiseonline/embetty-server
4. `yarn test`
## Caveats
The Embetty server component **does not proxy video data**. This means that **the tracking protection becomes ineffective after the play button has been clicked**.
Expand Down
4 changes: 2 additions & 2 deletions lib/embed/tweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Tweet extends Observable(Embed) {
}

get twitterUrl() {
return `https://twitter.com/statuses/${this._data.id_str}`
return `https://twitter.com/${this._data.user.screen_name}/status/${this._data.id_str}`
}

get createdAt() {
Expand Down Expand Up @@ -163,7 +163,7 @@ class Tweet extends Observable(Embed) {
</a>
{{/hasLinks}}
<a href="{{twitterUrl}}" target="_blank" rel="noopener" id="created-at">
<a href="{{twitterUrl}}" target="_blank" rel="noopener" id="created-at" class="tweet__link">
<time datetime="{{createdAt.toISOString}}">{{createdAt.toLocaleString}}</time>
via Twitter
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><defs><style>.cls-1{fill:none;}.cls-2{fill:#1da1f2;}</style></defs><path class="cls-2" d="M153.62,301.59c94.34,0,145.94-78.16,145.94-145.94,0-2.22,0-4.43-.15-6.63A104.36,104.36,0,0,0,325,122.47a102.38,102.38,0,0,1-29.46,8.07,51.47,51.47,0,0,0,22.55-28.37,102.79,102.79,0,0,1-32.57,12.45,51.34,51.34,0,0,0-87.41,46.78A145.62,145.62,0,0,1,92.4,107.81a51.33,51.33,0,0,0,15.88,68.47A50.91,50.91,0,0,1,85,169.86c0,.21,0,.43,0,.65a51.31,51.31,0,0,0,41.15,50.28,51.21,51.21,0,0,1-23.16.88,51.35,51.35,0,0,0,47.92,35.62,102.92,102.92,0,0,1-63.7,22A104.41,104.41,0,0,1,75,278.55a145.21,145.21,0,0,0,78.62,23"/></svg>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heise/embetty",
"version": "1.1.7",
"version": "1.1.8",
"main": "index.js",
"license": "MIT",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions test/tweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ describe('Tweet', () => {
})
})

it('tweet link should contain the username and the tweet id', async () => {
const { element } = await createTweet(Tweets.text)
const links = [...element.shadowRoot.querySelectorAll('.tweet__link')]
assert.strictEqual(links.length, 1)
assert.ok(links[0].getAttribute('href').includes('SiLVAFiSH'));
assert.ok(links[0].getAttribute('href').includes('934029337019416579'));
})

describe('Tweet body', () => {
it('should replace hash tags', async () => {
const { query } = await createTweet(Tweets.hashTag.valid)
Expand Down

0 comments on commit 4f2b576

Please sign in to comment.