Skip to content

Instantly share code, notes, and snippets.

View maswadkar's full-sized avatar

vivek maswadkar maswadkar

View GitHub Profile
@maswadkar
maswadkar / index.js
Created July 2, 2019 18:40
Reusing the Database Connection
const mongodb = require('mongodb');
const uri = 'mongodb+srv://OMITTED/test';
// May be retained between function executions depending on whether Azure
// cleans up memory
let client = null;
module.exports = function (context, req) {
context.log('Running');
@maswadkar
maswadkar / index.js
Last active July 2, 2019 18:39
azure function - mongodb
// credit goes to
//https://thecodebarbarian.com/getting-started-with-azure-functions-and-mongodb
const mongodb = require('mongodb');
// URI for MongoDB Atlas
const uri = 'mongodb://test.mongodb.net:27017';
module.exports = function (context, req) {
context.log('Running');
mongodb.MongoClient.connect(uri, function(error, client) {
@maswadkar
maswadkar / get_followers_list.py
Last active December 29, 2015 15:06
Get the list of twitter followers
import twitter
import pandas as pd
import time
def give_followers_list(screen_name):
total_followers = []
my_cursor = -1
while my_cursor != 0:
my_followers = t.followers.list(screen_name=screen_name,count=200,cursor=my_cursor)