Summary
This article details how to leverage browser text-to-speech APIs for audible tweet notifications on Twitter. A developer has provided a JavaScript snippet and is seeking interest in expanding it into a full browser extension.
Content Scores
Metric |
Min |
Max |
Mean |
Median |
Total |
Humor |
2 |
3 |
2.50 |
2.5 |
5 |
Helpfulness |
4 |
8 |
6.00 |
6.0 |
12 |
Aggression |
0 |
0 |
0.00 |
0.0 |
0 |
Spiciness |
0 |
0 |
0.00 |
0.0 |
0 |
Chunk-by-Chunk Analysis
Chunk Summary
This article explains how to use browser text-to-speech APIs to receive audible notifications for new tweets on Twitter pages.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
3 |
The title "Twitter, talk robot to me" and the concept of having a browser speak notifications offer a mild, quirky humor. The phrase "talk robot to me" is a playful adaptation of a common request. |
Helpfulness |
8 |
The text clearly explains a problem with Twitter notifications (lack of visibility) and provides a concrete, albeit technical, solution using browser APIs and JavaScript. It includes links to relevant resources and a code snippet for implementation. |
Aggression |
0 |
The text is purely informative and technical, with no negative or aggressive sentiment expressed. |
Spiciness |
0 |
The content is professional and technical, lacking any offensive or controversial material. |
Show Original Text
---
date: '2015-10-02'
frame: frame-front
frontTitle: Twitter, talk robot to me
published: true
subframe: frame-article
title: Twitter, talk robot to me
---
# Twitter, talk to me
Did you know browsers have text-to-speech APIs?
Twitter [user pages](https://twitter.com/Pinboard/with_replies) automatically poll for new tweets from the user, but when new tweets show up, the only notification you get is `(N)` added to the title of the webpage. If you have many tabs or browser windows or 5 monitors attached to your laptop, it's not easy to see when new tweets show up.
With a little help from [browser APIs](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html), you can get more noticable notifications.
Just paste the JavaScript below into an inspector window for any twitter [user](https://twitter.com/sadserver/with_replies) or [search](https://twitter.com/search?f=tweets&vertical=default&q=apples&src=typd) page. You'll get a quick voice notification when the page detects new tweets. The speak-on-new-tweet action remains until you reload or close your monitored tab(s).
Tested in recent Chrome and Safari as of October 2015:
```javascript
/* Extract username or search query from URL */
var urlEndpoint = $("link[rel=canonical]").attr("href").split("/")[3];
/* If this is a search URL, make the page name speakable. */
var name = urlEndpoint.replace("?q=", " ");
function speak(words) {
var msg = new SpeechSynthesisUtterance(words);
window.speechSynthesis.speak(msg);
}
$("div.js-new-items-bar-container").on("DOMSubtreeModified", function() {
/* Clicking the update notice clears the new items bar, but we
* don't want removal of content to trigger another voice response. */
Chunk Summary
A developer shared a JavaScript snippet and inquired if anyone was interested in developing it into a full extension.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
2 |
The text contains a mild, self-aware attempt at humor with the "Anybody want to turn it into a real extension?" question, implying the code snippet is perhaps incomplete or a bit of a tease. |
Helpfulness |
4 |
The code snippet itself is a functional piece of JavaScript, likely intended for a user interface interaction. However, without context or further explanation, its direct helpfulness to a broad audience is limited. The accompanying question is open-ended and not inherently helpful in providing actionable steps. |
Aggression |
0 |
The text is neutral and professional in tone, with no indication of negativity, anger, or depression. |
Spiciness |
0 |
The text is entirely professional and contains no offensive or inappropriate content. |
Show Original Text
if ($(this).is(":empty")) {
return;
}
speak(name + " TWEET!");
});
```
Anybody want to turn it into a real extension?