Naas Documentation
Naas.ai
GitHub
Slack Community
What's new?
Search…
Welcome to Naas
😎
Templates
AWS
Airtable
AlphaVantage
Bazimo
Boursorama
Bubble
CCXT
CSV
Canny
Celestrak
Cityfalcon
D-Tale
Dask
Data.gouv.fr
Draft Kings
EM-DAT
Elasticsearch
Excel
FAO
FEC
FTP
GitHub
Gmail
Google Analytics
Google Drive
Google Search
Google Sheets
HTML
Healthchecks
HubSpot
Hugging Face
IFTTT
IMDB
INPI
IUCN
Insee
Instagram
Integromat
Johns Hopkins
Jupyter
Jupyter Notebooks
LinkedIn
Matplotlib
Metrics Store
Microsoft Teams
Microsoft Word
MongoDB
MySQL
NASA
Naas
Naas Auth
Neo
Newsapi
Notion
OpenWeatherMap
OwnCloud
PDF
Pandas
Pillow
Pipedrive
Plaid
Plotly
PostgresSQL
PyPI
Python
Qonto
Quandl
Reddit
Redshift
Remoteok
Remotive
SAP-HANA
SendGrid
Slack
Snowflake
Societe.com
Spotify
Streamlit
Stripe
Telegram
Thinkific
TikTok
Trello
Twilio
Twitter
Schedule posts
Get posts stats
Get tweets stats from profile
Get tweets from search
Get user data
Post text and image
WSR
WorldBank
Worldometer
XML
YahooFinance
YouTube
Youtube
ZIP
Zapier
spaCy
Google Analytics
Google Drive
Google Search
Google Sheets
Hugging Face
Johns Hopkins
Jupyter Notebooks
Metrics Store
Microsoft Teams
Microsoft Word
Naas Auth
Elastic Search
Excel 365
🔄
Low-code features
🏎
Low-code drivers
🌎
Community
Essentials
Advanced
Best Practices
FAQ
⚡
Naas manager
🔐
Security
Powered By
GitBook
Schedule posts
Tags:
#twitter #automation #ifttt #naas_drivers #gsheet
Author:
Jeremy Ravenel
Input
Import library
1
from
datetime
import
datetime
2
import
naas_drivers
3
import
naas
Copied!
Variables
1
spreadsheet_id
=
"1rFzw8eeVNXyD5CEUjnpxVn_iA2hzabYKU6pRdmnZ3FQ"
Copied!
Model
Get data from Gsheet
1
df
=
naas_drivers
.
gsheet
.
connect
(
spreadsheet_id
).
get
(
2
sheet_name
=
"Sheet1"
3
)
4
df
Copied!
Get current date and time details
1
now
=
datetime
.
now
().
replace
(
second
=
0
,
microsecond
=
0
)
#the Naas scheduler only allow minutes
2
now
Copied!
1
# dd/mm/YY H:M:S
2
dt_string
=
now
.
strftime
(
"%d/%m/%Y %H:%M:%S"
)
# To mach date time format in google sheet
3
dt_string
Copied!
Schedule check every minute
If BROADCAST_DATE matches the current time then send twit from text column.
1
#naas.scheduler.delete()
2
naas
.
scheduler
.
add
(
recurrence
=
"* * * * *"
)
# to run every minute
Copied!
Output
If current date and column date in Gsheet matches then post
1
for
i
in
range
(
len
(
df
)):
2
print
(
dt_string
,
df
[
'BROADCAST_DATE'
][
i
])
3
if
dt_string
==
df
[
'BROADCAST_DATE'
][
i
]:
4
twitter_post
=
df
[
'TEXT'
][
i
]
5
event
=
"naas_demo"
6
key
=
"ke4AigvXI5-EABaowdLt4fju1aOUxeMxSXQoN8FVyA"
7
data
=
{
"value1"
:
twitter_post
}
8
result
=
naas_drivers
.
ifttt
.
connect
(
key
).
send
(
event
,
data
)
Copied!
Previous
Twitter
Next
Get posts stats
Last modified
2mo ago
Copy link
Edit on GitHub
Contents
Input
Model
Output