Discuss Scratch

mobluse
Scratcher
100+ posts

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

I would like to make a project that uses both Twitter and Text to Speech. Is this possible? If so, how?

http://technoboy10.tk/twitter/
http://sayamindu.github.io/scratch-extensions/text-to-speech

The project would speak tweets containing a special word.

Last edited by mobluse (June 11, 2017 17:43:13)


savaka
Scratcher
1000+ posts

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

You can load extensions when you are already in the project using the “Load Experimental Extension” button on the More Blocks tab. Paste the URL to the JS file, ex. https://technoboy10.github.io/twitter/extension.js
mobluse
Scratcher
100+ posts

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

savaka wrote:

You can load extensions when you are already in the project using the “Load Experimental Extension” button on the More Blocks tab. Paste the URL to the JS file, ex. https://technoboy10.github.io/twitter/extension.js
Thanks! This worked, but the speak block hangs after one use. Also, it's not always the tweet blocks load, but I have to load them manually after loading the sbx-file.

when green flag clicked
set [Time / 10 s = v] to [0]
switch costume to [parrot2-a v]
forever
set [tweet v] to (latest tweet from @[Raspberry_Pi])
if <<not <(tweet) = (tweet_save)>> and <not <(letter (1) of (tweet)) = [@]>>> then
set [tweet_save v] to (tweet)
broadcast [say v]
end
wait (9) secs
next costume
wait (1) secs
change [Time / 10 s = v] by (1)
next costume
end

when I receive [say v]
say (tweet)

speak (tweet)
When I put in the speak block it hangs after the first speech, no matter where I put it.

savaka
Scratcher
1000+ posts

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

mobluse wrote:

savaka wrote:

You can load extensions when you are already in the project using the “Load Experimental Extension” button on the More Blocks tab. Paste the URL to the JS file, ex. https://technoboy10.github.io/twitter/extension.js
Thanks! This worked, but the speak block hangs after one use. Also, it's not always the tweet blocks load, but I have to load them manually after loading the sbx-file.

when green flag clicked
set [Time / 10 s = v] to [0]
switch costume to [parrot2-a v]
forever
set [tweet v] to (latest tweet from @[Raspberry_Pi])
if <<not <(tweet) = (tweet_save)>> and <not <(letter (1) of (tweet)) = [@]>>> then
set [tweet_save v] to (tweet)
broadcast [say v]
end
wait (9) secs
next costume
wait (1) secs
change [Time / 10 s = v] by (1)
next costume
end

when I receive [say v]
say (tweet)

speak (tweet)
When I put in the speak block it hangs after the first speech, no matter where I put it.
That shouldn't be a result of loading the extension in that way
mobluse
Scratcher
100+ posts

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

savaka wrote:

mobluse wrote:

savaka wrote:

You can load extensions when you are already in the project using the “Load Experimental Extension” button on the More Blocks tab. Paste the URL to the JS file, ex. https://technoboy10.github.io/twitter/extension.js
Thanks! This worked, but the speak block hangs after one use. Also, it's not always the tweet blocks load, but I have to load them manually after loading the sbx-file.

When I put in the speak block it hangs after the first speech, no matter where I put it.
That shouldn't be a result of loading the extension in that way

It's a bug in Chromium in Raspbian on Raspberry Pi 2 (at least for me), but it works in Chrome in Windows 10 on a PC laptop.

The latest version of the complete program SpeakTweet is here:
http://scratchx.org/?url=https://mobluse.github.io/scratchx/speaktweet.sbx

Instructions:
Click a green flag. It reads selected tweets aloud. Tweets are selected if they contain a word: now “#raspberrypi”, and are not replies. An alarm starts sounding after that and you need to stop it by clicking the bell. Tweets are also stored in a list with the latest on top.

Sometimes Twitter doesn't load automatically, but then you can load it using Load Experimental Extension in More Blocks:
https://technoboy10.github.io/twitter/extension.js

Text to Speech, in case you need to load that manually:
http://sayamindu.github.io/scratch-extensions/text-to-speech/text_to_speech_extension.js

All ScratchX-programs by or remixed by me: https://mobluse.github.io/scratchx/

Last edited by mobluse (June 11, 2017 18:30:55)


Znapi
Scratcher
500+ posts

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

I opened an issue about the problem of SBX files and multiple extensions on github a while ago, so the ST are at least aware of it. Apparently it's not very important to them though, as it's been alive 3 years and marked as “backlog”.

To get around it, you can try one of those extension loader extensions, and make the first thing your project does when the green flag is pressed is load the extensions you actually want to use.

Last edited by Znapi (June 14, 2017 23:49:22)

greenflamestudios
Scratcher
1 post

Use two extensions at the same time: Twitter & Text to Speech, SpeakTweet

how do i find the extensions download link the only site with a download link is the spotify site

Powered by DjangoBB

Standard | Mobile