Skip to content

Instantly share code, notes, and snippets.

@bobquest33
bobquest33 / conf_sample.toml
Created April 25, 2017 06:36
100 Scripts in 30 Days challenge: Script 18,19,20 - Getting trending topics on Twitter using Tweepy
APP_NAME = ""
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
access_token = ""
access_token_secret = ""
@bobquest33
bobquest33 / conf_sample.toml
Created April 25, 2017 06:09
100 Scripts in 30 Days challenge: Script 17— Check Twitter Timeline using tweepy
APP_NAME = ""
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
access_token = ""
access_token_secret = ""
@bobquest33
bobquest33 / conf_sample.toml
Created April 25, 2017 05:39
100 Scripts in 30 Days challenge: Script 156— Searching Tweets using Twitter API
APP_NAME = ""
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
access_token = ""
access_token_secret = ""
@bobquest33
bobquest33 / code_twitter_ratelimit.py
Last active April 24, 2017 06:21
100 Scripts in 30 Days challenge: Script 15— Finding Rate limit details for Twitter API
# -*- coding: utf-8 -*-
import os
import sys
import twitter
import toml
import glob
import json
import tweepy
for conffilename in glob.glob('conf\\*.toml'):
@bobquest33
bobquest33 / conf.toml
Last active April 21, 2017 19:57
100 Scripts in 30 Days challenge: Script 14— OAuth Authentication Using Twitter
APP_NAME = ""
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
@bobquest33
bobquest33 / startup_time.py
Last active April 21, 2017 07:01
100 Scripts in 30 Days challenge: Script 13 - Checking Windows Uptime Since Restart with wmi
import datetime
import wmi
wmiob = wmi.WMI()
sdata = wmiob.Win32_PerfFormattedData_PerfOS_System()
uptime = sdata[-1].SystemUpTime
tnow = datetime.datetime.now()
utime = datetime.timedelta(seconds=int(uptime))
boot = tnow-utime
bootime = "Boot time was around {}:{}:{}".format(boot.hour, boot.minute, boot.second)
@bobquest33
bobquest33 / search-sample.txt
Created April 19, 2017 03:45
100 Scripts in 30 Days challenge: Script 11 & 12 — Web Scraping with requests Module
https://github.com/arturolp/ebmc-weka/releases/download/v1.0/ebmc.zip
http://gradients.lboro.ac.uk/cocn3/weka-GPAttributeGeneration1.0.0.zip
http://prdownloads.sourceforge.net/modlem/package-modlem1.0.0.zip?download
https://github.com/glaubercini/ipcp/raw/master/packages/IPCP_1_0_1.zip
http://prdownloads.sourceforge.net/fsvc/CVAttributeEval1.0.0.zip?download
http://prdownloads.sourceforge.net/weka/alternatingDecisionTrees1.0.6.zip?download
http://prdownloads.sourceforge.net/weka/NNge1.0.3.zip?download
http://prdownloads.sourceforge.net/weka/EMImputation1.0.1.zip?download
http://prdownloads.sourceforge.net/moefc/MultiObjectiveEvolutionaryFuzzyClassifier1.0.0.zip?download
https://github.com/chrispy645/spmf-wrapper/releases/download/0.0.2/spmfWrapper.zip
@bobquest33
bobquest33 / Sample_Execution.txt
Created April 18, 2017 17:19
100 Scripts in 30 Days challenge: Create REST API and run any where with “hug”
As Python API
-------------
C:\Users\IBM_ADMIN\Documents\python\test\100_script_30_day_challenge\using_hug>python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from hug_versioned_api import *
>>> singular("Silly Walks")
'Silly Walk'
>>> plural("Silly Walk")
@bobquest33
bobquest33 / sample_commandline.log
Created April 17, 2017 20:21
100 Scripts in 30 Days challenge: Script 8 — Capture shell output to log using cmd module
C:\Users\IBM_ADMIN\Documents\python\test\100_script_30_day_challenge\using_cmd>python use_cmd.py
Starting prompt...
> shell rm shell*
2017-04-18 01:46:55,795 - rm shell*
2017-04-18 01:46:56,095 - "rm: cannot unlink `shell20170418-014641.log': Permission denied"
> shell cd "C:\Program Files\IBM\BMS\ILC" & "C:\Program Files\IBM\BMS\ILC\ilcnew.bat"
2017-04-18 01:47:11,485 - cd "C:\Program Files\IBM\BMS\ILC" & "C:\Program Files\IBM\BMS\ILC\ilcnew.bat"
2017-04-18 01:47:11,568 - 'Starting ILC in C:\\Users\\IBM_ADMIN\\IBM\\BMS\\ILC ...'
2017-04-18 01:47:11,571 - 'Executed "C:\\Program Files\\IBM\\BMS\\ILC" batch, redirecting to "C:\\Users\\IBM_ADMIN\\IBM\\BMS\\ILC" batch'
2017-04-18 01:47:11,592 - 'Starting ILC in C:\\Users\\IBM_ADMIN\\IBM\\BMS\\ILC ...'
@bobquest33
bobquest33 / config.yaml
Created April 17, 2017 11:53
100 Scripts in 30 Days challenge: Script 7 — Creating Amazon Lambda Service using python-lambda
region: us-east-1
function_name: my_lambda_function
handler: service.handler
# role: lambda_basic_execution
description: My first lambda function
# if access key and secret are left blank, boto will use the credentials
# defined in the [default] section of ~/.aws/credentials.
aws_access_key_id: <AWS_ID>