DEV Community

Discussion on: Send daily automated tweets from a Google Sheet by using Google Scripts

Collapse
 
igyver profile image
Kay • Edited

Hi Alberto, just another question. I want to create more than one tweet per day. One of the regular tweets will be a countdown until an event.

I could now do the same with another Google Spreadsheet but I would love to use the same document but another tab.

I checked the google information and I miss the idea how I could create an function that refers to an tab2 instead only tooks the first.

So I also don't understand what is an "active" sheet and what is not. Do you have any idea?

Collapse
 
igyver profile image
Kay

Next Challenge solved. Different tweets from the same source with different content. Works fine.

I'm really excited.

Collapse
 
albertomontalesi profile image
AlbertoM

Awesome, what's your twitter profile?

Thread Thread
 
igyver profile image
Kay • Edited

the Google Sheet solution is working for "SaMDExpert"

It's a very new account and with an direct purpose to support Software as a Medical Device Industry, StartUps and NGOs products.

Collapse
 
igyver profile image
Kay

So, direct after I wrote the question I guess I found it. :)

developers.google.com/apps-script/...

So now I have to make some tests. :)

Collapse
 
albertomontalesi profile image
AlbertoM

Awesome!

Thread Thread
 
igyver profile image
Kay • Edited

Done. Works. :) Is just not as complicated as thought. I love it.

@AngeloM Thank you for the inspiration.

How I have done it. Just created a second sheet and copied the original Script. I change the first rows to:

function sendDailyTweet2() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
SpreadsheetApp.setActiveSheet(sheet.getSheets()[1]);

....

Thread Thread
 
albertomontalesi profile image
AlbertoM

Awesome, if you want to go further you can try adding images to your tweets.

Thread Thread
 
igyver profile image
Kay

I'm familiar with Markup but Dev.to is using something different so I didnt spend so much time for that.

But of course, I'll do it as soon as I figured out how it works. :)