This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let event = new Event(auth); | |
event.addEvent('Summary','Description','2020-03-16T11:00:00','2020-03-18T11:00:00'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createRef } from "react"; | |
import { StyleSheet, Text, View, Button } from 'react-native'; | |
import ActionSheet from "react-native-actions-sheet"; | |
const actionSheetRef = createRef(); | |
// This Menu component is fully customizable. Add whatever you want!! | |
const Menu = () => ( | |
<View style={styles.drawerContent} > | |
<Text>Hello There</Text> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { View, Text, Button, StatusBar } from 'react-native'; | |
import auth from '@react-native-firebase/auth'; | |
import { GoogleSignin } from '@react-native-community/google-signin'; | |
GoogleSignin.configure({ | |
webClientId: '', | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {google} = require('googleapis'); | |
var base64 = require('js-base64').Base64; | |
const parse = require('node-html-parser').parse; | |
const cheerio = require('cheerio'); | |
var open = require('open'); | |
var Mailparser = require('mailparser').MailParser; | |
class Check{ | |
constructor(auth){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {google} = require('googleapis'); | |
class Event { | |
//This auth object should be passed whenever a new instance of class is created in order to authenticate the requests. | |
constructor(auth){ | |
this.auth = auth; | |
this.calendar = google.calendar({version: 'v3', auth}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const readline = require('readline'); | |
const {google} = require('googleapis'); | |
// If modifying these scopes, delete token.json. | |
const SCOPES = ['https://www.googleapis.com/auth/gmail.readonly','https://www.googleapis.com/auth/gmail.modify', | |
'https://www.googleapis.com/auth/gmail.compose','https://www.googleapis.com/auth/gmail.send']; | |
// The file token.json stores the user's access and refresh tokens, and is | |
// created automatically when the authorization flow completes for the first | |
// time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
x = { | |
"sum": int(sys.argv[1]) + int(sys.argv[2]) | |
} | |
print(json.dumps(x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//We will have to create a childprocess in order tocall python script. | |
var spawn = require("child_process").spawn; | |
//This process is called here. | |
var process = spawn('python',["./add.py",7,3] ); | |
//We listen for 'data' event. | |
process.stdout.on('data', function (data) { | |
console.log("Sum " + JSON.parse(data.toString()).sum); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAuth(auth){ | |
var Check = require('./Check'); | |
var obj = new Check(auth); | |
obj.checkForMediumMail(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//getMail function retrieves the mail body and parses it for useful content. | |
//In our case it will parse for all the links in the mail. | |
getMail(msgId){ | |
//This api call will fetch the mailbody. | |
this.gmail.users.messages.get({ | |
'userId': this.me, | |
'id': msgId | |
}, (err, res) => { | |
if(!err){ |
NewerOlder