Objective
This article will exlpain about working on Logic Apps and integrating Twitter API and Google Drive API. We will be using Logic Apps here to search for a keyword on Twitter and save the tweets for the Google Drive on the specified location.
Prerequisites
- Azure Subscription – Click here to sign up for a free Azure account.
- Google account
Follow the below-given steps now.
Step – 1
Sign in to the Azure Resource Manager portal using www.portal.azure.com; log in with the Azure credentials here.
Step – 2
On the Azure Resource Manager portal, go to New >> Web + Mobile >> Logic App.
Create a Logic App by giving the below details.
- Name – Name the logic app here.
- Subscription – Select the subscription on which the resource must be deployed.
- Resource Group – Select the resource group for which the resource has to be tagged for.
- Location – Select the Data Center location on which the resource has to be deployed.
Click on “Create” to create the logic app.
Once the logic app gets deployed, we can find the notification at the notification panel.
Go to the “overview” blade of the logic app and click on “Blank Logic App” from the templates panel.
Step – 3
Search for Twitter API and select “Twitter – When a new tweet is posted”.
Click on “Sign in” to sign in to the Twitter account.
Enter the Twitter credentials as shown below. Click on “Authorize app” to authorize the Twitter account.
Step – 4
Fill in the below fields:
Search text – enter the keyword which must be searched in the format of #abc.
Then, enter the time interval and the frequency of how often the check has to be done.
Step – 5
Add the next action for Google API, click on "New Step".
Type "Google Drive" into the search bar and select "Google Drive API".
Select “Google Drive – Create file” on “Actions”.
Click on “Sign in” and sign in to your Google account.
Give the Google account credentials for which the tweets must be saved on the Google Drive.
On the next screen, click on “Allow” to allow the Azure App Service Logic Apps to view and manage the files on Google Drive.
Create a "New Folder" to save all the tweets by clicking on New >> Folder and name the folder as “Logic Apps” followed by a click on “Create”.
Folder Path
Select the folder path on which the tweets must be saved. Click on the browse option and select the path from the Google Drive as shown below.
File Name
Name the file here for the tweets of Logic Apps.
File Content
Select the file content such as Description, Location, and Name which must be saved on the Google Drive.
Click on “Save” to save the Logic Apps.
Once the logic app is saved, we can find the notification that the Logic App was saved successfully.
Click on “Run” to run the Logic App from the Azure portal.
When the Logic App starts running, we can find the status after every three minutes in the notification panel.
Now, log in to Twitter and post a demo tweet including the keyword on Twitter. This tweet with the description and name can be seen at Google Drive. Not just this, but all the tweets with the specific keyword which was given at the Logic App designer can be seen on the Google Drive.
The resource group on which the resource has been located can be deleted by selecting the resource group and clicking on “Delete resource group”.
We can find the status of the resource group deletion on the notification panel, as shown on the Azure portal.
Summary
Here, we are done with integrating the Twitter API and Google Drive API for saving the tweets on Google Drive using Logic Apps.