Skip to content

Commit

Permalink
add plugin: get trending topic
Browse files Browse the repository at this point in the history
  • Loading branch information
gojigeje committed Mar 7, 2015
1 parent 79a014f commit 214f952
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions plugin/trending.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
#
# nama plugin : trending
# deksripsi : twit 4 trending topic terbaru
# default menampilkan trendi Indonesia, sesuaikan dengan mengubah WOEID
#
# cara pakai : twit_trending [WOEID]
#

aksi_array+=("twit_trending")

# main method
twit_trending_main() {
if [[ -z "$1" ]]; then
woeid="23424846"
else
woeid="$1"
fi

getJam

echo "[trending] [$getjam] get 4 top trending.."

# get 4 top trending
twit --trending=23424846 | sed 's/trends/top 4 trending ['$getjam']/g' | head -n 5 > "temp/trending.output"

cat "temp/trending.output"

# twit it
twit -s "`cat temp/trending.output`"

echo "[trending] done.."

exit
# very simple :|
}

0 comments on commit 214f952

Please sign in to comment.