Search

twitter search hashtag or username from bash

twitter search hashtag or username from bash
#!/bin/bash # # Search for the latest tweets # # This script is based in part on a solution proposed by Mike Bounds # in the twitter discussion forum: https://dev.twitter.com/discussions/14460 ################## # Modified to fix searching for hashtags # and usernames @ by Greg Fenton # http://labby.co.uk ################## set -o errexit screen_name=gregoryfenton query="#candy4greg OR @gregoryfenton" query=`echo "$query" | sed 's/%/%25/g'... Read More

bash download from url list into directories

bash download from url list into directories
Prerequisite: the file specified by urlFile must exist and contain a list of URLs, one per line. baseDir is where the files will end up. It will be created if it does not exist. splitText is the text that will be split in each URL example: http://www.example.com/textfiles/subdir1/subdir2/filename.txt #!/bin/bash #user serviceable area, change to your needs urlFile="../urllist.txt" baseDir="files/" #end user serviceable... Read More

bash split string every n characters

bash split string every n characters
Today I needed to split a string in bash every 5 characters. Here is how I did it: a="AdmitAfritAmbitAuditAwaitBefitBinitBruitCubitDavitDebitDemitDigitDixitDroitFixitFruitHabitKraitLegitLicitLimitMeritOrbitPetitPewitPipitPlaitPositQubitQuoitRecitRefitRelitRemitResitSpaitSplitSpritTacitTraitUnfitUnlitUnwitUplitVisitVomitZizit" count=5 # change 5 to however many characters you wish to break on b="$a" while ; do echo "${b:0:$count}" b="${b:$count}" done I hope this snippet helps somebody. If it does, please feel free to leave a comment... Read More