Skip to content

Commit

Permalink
add description text on each plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gojigeje committed Feb 22, 2015
1 parent c837fb7 commit 36de67d
Show file tree
Hide file tree
Showing 19 changed files with 170 additions and 24 deletions.
2 changes: 2 additions & 0 deletions plugin/0_cekposting.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# plugin disabled, mungkin akan dihapus nanti

# aksi_array+=("twit_cekposting")

cekposting() {
Expand Down
10 changes: 10 additions & 0 deletions plugin/1cak.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/bin/bash
#
# nama plugin : 1cak
# deksripsi : plugin untuk mengambil dan memposting gambar meme dari 1cak.com
#
# cara pakai : twit_1cak "keyword"
#
# bila keyword tidak diisi, akan posting meme random
# bila keyword diisi, akan mencari 6 meme dengan keyword tsb dan
# memposting salah satu diantaranya
#

aksi_array+=("twit_1cak")

Expand Down
7 changes: 7 additions & 0 deletions plugin/autoreply-command.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/bin/bash
#
# nama plugin : autoreply_command
# deksripsi : plugin tambahan untuk menentukan sebuah mention merupakan command atau bukan
# plugin ini dipanggil lewat script autoreply.sh
#

# TODO:
# !stop
# !gombalin
# !ejekin

# list username admin, pisahkan dengan spasi
ngadimin="@gojigeje @gojibuntu"

cekngadimin() {
Expand Down
12 changes: 10 additions & 2 deletions plugin/autoreply.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#!/bin/bash
#
# Need package coreutils-paste + coreutils-sort (use --force-overwrite)
# nama plugin : autoreply
# deksripsi : cek mention ke bot (gojibox) dan reply dengan $respon yang dipilih secara acak
# + cek mention merupakan command apa bukan (reply_command), kalau command
# maka proses selanjutnya akan dihandle script autoreply-command.sh
#
# cara pakai : twit_reply
# panggil via crontab tiap x menit
#
# keterangan : kayaknya harus install paket coreutils-paste + coreutils-sort (use --force-overwrite)

# aksi_array+=("twit_reply")
# aksi_array+=("twit_reply") # panggil via crontab
aksi_nolog="1"
touch "temp/reply_replied"

Expand Down
6 changes: 6 additions & 0 deletions plugin/bacot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#
# nama plugin : bacot
# deksripsi : ngebacot twit random
#
# cara pakai : twit_bacot
#

aksi_array+=("twit_bacot")

Expand Down
41 changes: 25 additions & 16 deletions plugin/0_conan.sh → plugin/conan.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/bash
#
# nama plugin : conan
# deksripsi : posting episode terbaru serial Detective Conan dari gogoanime.com
#
# cara pakai : twit_conan
#
# keterangan : jalankan via crontab, video conan subbed biasanya rilis tiap hari selasa
# set crontab tiap hari selasa rabu atau kamis
#

# aksi_array+=("twit_conan")

twit_conan_main() {

CONANFILE="temp/conan"
rm "$CONANFILE"*
rm temp/conan*
getJam

echo -n "[$getjam] Downloading detective conan page.."
Expand Down Expand Up @@ -42,7 +51,7 @@ twit_conan_main() {
echo -n "-- checking $conan_link.. "

# belum rilis
if grep -q "/images/goodmanga.jpg" "$CONANFILE.cek" ; then
if grep -q "/images/goodmeme.jpg" "$CONANFILE.cek" ; then
echo "[belum rilis]"
else

Expand All @@ -65,10 +74,10 @@ twit_conan_main() {
entri="plugin_conan_last"
if [[ "$plugin_conan_last" = "" ]]; then
if grep -q "$entri" "plugin/plugin.conf" ; then
# echo "entri ada tapi kosong, replace"
echo "entri ada tapi kosong, replace"
sed -i 's/'$entri'*.*/'$entri'="'$terbaru'"/g' "plugin/plugin.conf"
else
# echo "entri ga ada, insert"
echo "entri ga ada, insert"
echo "$entri=\"0\"" >> "plugin/plugin.conf"
plugin_conan_last="0"
fi
Expand All @@ -77,20 +86,18 @@ twit_conan_main() {
if [[ "$terbaru" -gt "$plugin_conan_last" ]]; then
# getJam
status="[gogoanime] Update! Det.Conan Anime episode $terbaru udah rilis..! ~ Liat dimari: $conan_link ~ cc @gojigeje"
echo "- [ttytter] : $status"
ttytter -status="$status" -newline

# echo "isinya nggak sama, replace"
echo "isinya nggak sama, replace"
sed -i 's/'$entri'*.*/'$entri'="'$terbaru'"/g' "plugin/plugin.conf"

entri="plugin_conan_posted"
sed -i 's/'$entri'*.*/'$entri'="1"/g' "plugin/plugin.conf"
if [[ "$plugin_conan_posted" = "" ]]; then
if grep -q "$entri" "plugin/plugin.conf" ; then
# echo "entri ada tapi kosong, replace"
echo "entri ada tapi kosong, replace"
sed -i 's/'$entri'*.*/'$entri'="'$terbaru'"/g' "plugin/plugin.conf"
else
# echo "entri ga ada, insert"
echo "entri ga ada, insert"
echo "$entri=\"1\"" >> "plugin/plugin.conf"
fi
fi
Expand All @@ -102,31 +109,33 @@ twit_conan_main() {
entri="plugin_conan_posted"
if [[ "$plugin_conan_posted" = "" ]]; then
if grep -q "$entri" "plugin/plugin.conf" ; then
# echo "entri ada tapi kosong, replace"
echo "entri ada tapi kosong, replace"
sed -i 's/'$entri'*.*/'$entri'="'$num'"/g' "plugin/plugin.conf"
else
# echo "entri ga ada, insert"
echo "entri ga ada, insert"
echo "$entri=\"$num\"" >> "plugin/plugin.conf"
fi
fi

if [[ $num -lt 3 ]]; then
if [[ $num -lt 2 ]]; then
# getJam
status="[gogoanime] Update! Det.Conan Anime episode $terbaru udah rilis..! ~ Liat dimari: $conan_link ~ cc @gojigeje"
echo "- [ttytter] : $status"
ttytter -status="$status" -newline

let num++;
# echo "isinya nggak sama, replace"
echo "isinya nggak sama, replace"
sed -i 's/'$entri'*.*/'$entri'="'$num'"/g' "plugin/plugin.conf"
else
if [[ "$terbaru" == "$plugin_conan_last" ]]; then
echo "- Episode udah paling baru [$terbaru].. dan udah di twit 3x.. gak ngetwit.."
echo "- Episode udah paling baru [$terbaru].. dan udah di twit 2x.. gak ngetwit.."
fi
fi

fi

# tweet
echo "[twit] $status"
twit -s "$status"

echo "- done -"
exit 1
}
Expand Down
13 changes: 13 additions & 0 deletions plugin/cuaca.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/bin/bash
#
# nama plugin : cuaca
# deksripsi : ambil data cuaca dari BMKG (data.bmkg.go.id) lalu posting ke twitter
#
# cara pakai : twit_cuaca "nama kota"
#
# keterangan : di website data.bmkg.go.id ada beberapa file dumping data cuaca
# dengan nama propinsi_xx_1.xml yang berakhiran _1.xml adaah cuaca hari ini,
# sedang yang berakhiran _2.xml adalah cuaca besok hari.
#
# di plugin ini dicontohkan propinsi_16_, silahkan disesuaikan dengan file
# kota kamu (cari satu per satu)
#

# aksi_array+=("twit_cuaca")

Expand Down
8 changes: 8 additions & 0 deletions plugin/ejek.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
#
# nama plugin : ejek
# deksripsi : ejek {target} dengan sekejam-kejamnya :D
#
# cara pakai : twit_ejek
#
# keterangan : file tempat menuliskan target ada di target.sh
#

aksi_array+=("twit_ejek")

Expand Down
7 changes: 6 additions & 1 deletion plugin/github.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
#
# Need package coreutils-paste + coreutils-sort (use --force-overwrite)
# nama plugin : github
# deksripsi : posting aktifitas github terbaru @gojigeje ke twitter
#
# cara pakai : twit_github
#
# keterangan : kayaknya harus install dulu paket coreutils-paste + coreutils-sort (use --force-overwrite)

# aksi_array+=("twit_github")
aksi_nolog="1"
Expand Down
7 changes: 7 additions & 0 deletions plugin/gombal.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#
# nama plugin : gombal
# deksripsi : godain cewek-cewek dengan menggombalinya :D
# gombalan dipilih acak, list target ada di script ini
#
# cara pakai : twit_gombal
#

aksi_array+=("twit_gombal")

Expand Down
8 changes: 8 additions & 0 deletions plugin/greetings-ramadhan.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
#
# nama plugin : greetings_ramadhan
# deksripsi : twit sapaan ke $target acak, tema ramadhan
#
# cara pakai : twit_ramadhan_greet
#
# keterangan : file tempat menuliskan target ada di target.sh
#

#aksi_array+=("twit_ramadhan_greet")

Expand Down
8 changes: 8 additions & 0 deletions plugin/greetings.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
#
# nama plugin : greetings
# deksripsi : twit sapaan ke $target secara acak
#
# cara pakai : twit_greeting
#
# keterangan : file tempat menuliskan target ada di target.sh
#

aksi_array+=("twit_greeting")

Expand Down
16 changes: 16 additions & 0 deletions plugin/imsakiyah.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash
#
# nama plugin : imsakiyah
# deksripsi : twit jadwal sholat
#
# cara pakai : twit_imsakiyah [mlg|tag]
#
# keterangan : dicontohkan kota malang dan tulungagung (mlg|tag)
# data jadwal sholat diambil dari jadwalsholat.org
# data imsakiyah ramadhan diambil dari rukyatulhilal.org
#
# data diambil dan ditulis ulang secara manual mengikuti pola
# yang sudah ditentukan:
#
# # 1231 mlg [jadwal sholat yang ditampilkan]
# # mm:dd kota [jadwal sholat yang ditampilkan]
#

# aksi_array+=("twit_imsakiyah")

Expand Down
9 changes: 9 additions & 0 deletions plugin/kernel-mainline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash
#
# nama plugin : kernel-mainline
# deksripsi : posting kernel mainline ubuntu versi terbaru (stable) ke twitter
#
# cara pakai : twit_kernel
#
# keterangan : data diambil dari http://kernel.ubuntu.com/~kernel-ppa/mainline/
# ditampilkan versi stable saja.
#

# aksi_array+=("twit_kernel")

Expand Down
9 changes: 9 additions & 0 deletions plugin/superman.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash
#
# nama plugin : superman
# deksripsi : twit link + gambar thumbnail video terbaru dari playlist youtube
#
# cara pakai : twit_superman
#
# keterangan : dicontohkan playlist The Return of Superman
# https://www.youtube.com/playlist?list=PLMf7VY8La5RFIeOyIZ5IOm68WVb7c2dyT
#

# aksi_array+=("twit_superman")

Expand Down
8 changes: 6 additions & 2 deletions plugin/target.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#
# nama plugin : target
# deksripsi : array yang berisi username target mention, digunakan oleh plugin
# ejek, greetings, dll
#

target_array=(
"@afandie5"
"@aftaonline"
Expand Down Expand Up @@ -40,5 +46,3 @@ target_array=(
# "@ulinzulfa"
# "@Zheezayn"
)


8 changes: 8 additions & 0 deletions plugin/unfollowers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
#
# nama plugin : unfollowers
# deksripsi : twit statistik follower ngaco
#
# cara pakai : twit_unfollowers
#
# keterangan : nothing special
#

aksi_array+=("twit_unfollowers")

Expand Down
9 changes: 9 additions & 0 deletions plugin/uptime.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/bash
#
# nama plugin : uptime
# deksripsi : twit uptime sistem
#
# cara pakai : twit_uptime
#
# keterangan : selain ngetwit uptime, script juga nyatet data uptime sistem terpanjang
# buat pamer
#

aksi_array+=("twit_uptime")

Expand Down
6 changes: 3 additions & 3 deletions tweet.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
# -------------------------------------------------------------------------

# change directory to script's directory
# cd /root/script/twit
cd /home/goji/git/openwrt-twitterbot
# cd to script's directory
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd "$DIR"

setup() {
hari=$(date +%u)
Expand Down

0 comments on commit 36de67d

Please sign in to comment.