Twitteran di konsole !
#11
(11-12-2011, 01:11 AM)RR12 Wrote: @nyelonong
wadduuuhh itu kan scriptnya ada diatas om !! ehehehhe
ini loh ..

Code:
import twitter
import sys
import time
import os

costumer_key = 'sesuaikan dengan key anda n tetap pake tanda petik'
costumer_secret = 'sesuaikan dengan key anda n tetap pake tanda petik'
access_token = 'sesuaikan dengan key anda n tetap pake tanda petik'
access_token_secret = 'sesuaikan dengan key anda n tetap pake tanda petik'

#example
#costumer_key = 'NQMPxdgVMAJGe1b2g3h4j'
#costumer_secret = 'WhBNeJaeWG4eypSclU2tVbIGdkeoo41b2g3f4h5f'
#access_token = '126010565-2q4e9njh7dblYNmpEm3hQ1lbT1M17NwaSAgEvrr'
#access_token_secret = '2q4e9njh7dbHO004GPv2f9OqA97FRw3DxaX5BET4A'

api = twitter.Api(consumer_key=costumer_key,consumer_secret=costumer_secret, access_token_key=access_token, access_token_secret=access_token_secret)

def starter():
    if os.name == 'posix':
        os.system('clear')
    else:
        os.system('cls')
    info = '''
_            _ _   _            
| |___      _(_) |_| |_ ___ _ __
| __\ \ /\ / / | __| __/ _ \ '__|
| |_ \ V  V /| | |_| ||  __/ |  
\__| \_/\_/ |_|\__|\__\___|_|     Client Apps
                                   by RR12
                                   [email protected]
                                   http://khairil12.blogspot.com
                                

[1] Tweet something
[2] Show your following list
[3] Show your past tweet
[4] Show the newest tweet
[5] Show tweets who mention you
[6] Follow someone
[X] X for Exit

\n
'''
    for i in info:
        print '\b%s' %(i),
        sys.stdout.flush()
        time.sleep(0.005)

    choice = raw_input('[>] Please input your choice : ')
    main(choice)

def main(option=None):
    if option == '1':
        try:
        status_update = raw_input('[>] What\'s happening? ')
        print '[>] Please waiting ... \n'
        api.PostUpdate(status_update)
        print '[>] Your tweet has benn updated >> \"%s\"' %(status_update)
        except:
        print '[>] There\'s something wrong, bro !! failed to tweet !'
        sys.exit('[>] Exit !')
        
    elif option == '6':
        try:
        follow = raw_input('[>] Please input a username that will follow : ')
        print '[>] Please waiting ... \n'
        api.CreateFriendship(follow)
        print '[>] You have following >> %s !"' %(follow)
        except:
        print '[>] There\'s something wrong, bro !! failed to follow !'
        sys.exit('[>] Exit !')
    
    elif option == '2':
        try:
        print '[>] Please waiting ... \n'
        friends = api.GetFriends()
        for i in friends:
            print '''==================================
          by RR12            
ID           : %s
Name         : %s
Location     : %s
Created at   : %s
Description  : %s
            
            ''' %(i.id, i.name, i.location, i.created_at, i.description)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show the friend list !'
        sys.exit('[>] Exit !')

    elif option == '3':
        try:
            print '[>] Please waiting ... \n'
            past_tweet = api.GetUserTimeline()
            for i in past_tweet:
            print '''==================================
          by RR12            
Created at   : %s
Tweet        : %s
            
                ''' %(i.created_at, i.text)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show your tweet !'
        sys.exit('[>] Exit !')
        
    elif option == '4':
        try:
        print '[>] Please waiting ... \n'
        friends = api.GetFriendsTimeline()
        for i in friends:
                print '''==================================
          by RR12            
Username       : %s
Tweet        : %s
Created at    : %s
            
                ''' %(i.user.name, i.text, i.relative_created_at)
            time.sleep(2)
            
        except:
        print '[>] There\'s something wrong, bro !! failed to show lastest tweet !'
        sys.exit('[>] Exit !')
    
    elif option == '5':
        try:
        print '[>] Please waiting ... \n'
        mentions = api.GetReplies()
        for i in mentions:
            print '''==================================
          by RR12            
Username       : %s
Created at    : %s
Tweet        : %s
            
            ''' %(i.user.name, i.created_at, i.text)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show your post replies (MENTIONS) !'
        sys.exit('[>] Exit !')
    
    elif option in ('X', 'x', 'Exit', 'exit'):
        sys.exit('\n[+] Thank you, bro !! \n\n[*]Exit')    
        
    else:
        sys.exit('\n[*] Wrong choice, bro !! \n\n[*]Exit')
    

if __name__=='__main__':
    lagi = 'y'
    while lagi in ('y','Y','Yes', 'YES'):
        starter()
    lagi = raw_input('[>] Do you want to user this app again ? ')
    
    sys.exit('\n[+] Thank you, bro !! \n\n[*]Exit')

maksudnya buat file .py baru make yg isinya script itu yah? tp kok error om
Code:
root@bt:~# python jacktwit.py
  File "jacktwit.py", line 55
    status_update = raw_input(' [>] What\'s happening? ')
                ^
IndentationError: expected an indented block
sorry nih om kebanyakan nanya, pengguna baru bgt om.. hehe


#12
(11-12-2011, 01:40 AM)nyelonong Wrote:
(11-12-2011, 01:11 AM)RR12 Wrote: @nyelonong
wadduuuhh itu kan scriptnya ada diatas om !! ehehehhe
ini loh ..

pusing juga sy udah sy kasih tag CODE tapi masih gug beres tab/spasi nya !! heheh
kesini aja om
Code:
http://www.rr12.webatu.com/tools/RRTwitter.py
udah ane test !! insyaallah work .. ekekekke :apn:
oufh itu masalah tab/spasi nya yg gug sesuai jadi blok code programnya kacau !! hehehe
sy juga gug tau padahal dah pake tag CODE n langsung copas dari editor ku !!

om kesini aja http://www.rr12.webatu.com/tools/RRTwitter.py

udah sy test .. insyaallh work . ekekekke :apn:
[quote='nyelonong' pid='11624' dateline='1321033220']
[quote='RR12' pid='11619' dateline='1321031509']
@nyelonong
wadduuuhh itu kan scriptnya ada diatas om !! ehehehhe
ini loh ..

Code:
import twitter
import sys
import time
import os

costumer_key = 'sesuaikan dengan key anda n tetap pake tanda petik'
costumer_secret = 'sesuaikan dengan key anda n tetap pake tanda petik'
access_token = 'sesuaikan dengan key anda n tetap pake tanda petik'
access_token_secret = 'sesuaikan dengan key anda n tetap pake tanda petik'

#example
#costumer_key = 'NQMPxdgVMAJGe1b2g3h4j'
#costumer_secret = 'WhBNeJaeWG4eypSclU2tVbIGdkeoo41b2g3f4h5f'
#access_token = '126010565-2q4e9njh7dblYNmpEm3hQ1lbT1M17NwaSAgEvrr'
#access_token_secret = '2q4e9njh7dbHO004GPv2f9OqA97FRw3DxaX5BET4A'

api = twitter.Api(consumer_key=costumer_key,consumer_secret=costumer_secret, access_token_key=access_token, access_token_secret=access_token_secret)

def starter():
    if os.name == 'posix':
        os.system('clear')
    else:
        os.system('cls')
    info = '''
_            _ _   _            
| |___      _(_) |_| |_ ___ _ __
| __\ \ /\ / / | __| __/ _ \ '__|
| |_ \ V  V /| | |_| ||  __/ |  
\__| \_/\_/ |_|\__|\__\___|_|     Client Apps
                                   by RR12
                                   [email protected]
                                   http://khairil12.blogspot.com
                                

[1] Tweet something
[2] Show your following list
[3] Show your past tweet
[4] Show the newest tweet
[5] Show tweets who mention you
[6] Follow someone
[X] X for Exit

\n
'''
    for i in info:
        print '\b%s' %(i),
        sys.stdout.flush()
        time.sleep(0.005)

    choice = raw_input('[>] Please input your choice : ')
    main(choice)

def main(option=None):
    if option == '1':
        try:
        status_update = raw_input('[>] What\'s happening? ')
        print '[>] Please waiting ... \n'
        api.PostUpdate(status_update)
        print '[>] Your tweet has benn updated >> \"%s\"' %(status_update)
        except:
        print '[>] There\'s something wrong, bro !! failed to tweet !'
        sys.exit('[>] Exit !')
        
    elif option == '6':
        try:
        follow = raw_input('[>] Please input a username that will follow : ')
        print '[>] Please waiting ... \n'
        api.CreateFriendship(follow)
        print '[>] You have following >> %s !"' %(follow)
        except:
        print '[>] There\'s something wrong, bro !! failed to follow !'
        sys.exit('[>] Exit !')
    
    elif option == '2':
        try:
        print '[>] Please waiting ... \n'
        friends = api.GetFriends()
        for i in friends:
            print '''==================================
          by RR12            
ID           : %s
Name         : %s
Location     : %s
Created at   : %s
Description  : %s
            
            ''' %(i.id, i.name, i.location, i.created_at, i.description)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show the friend list !'
        sys.exit('[>] Exit !')

    elif option == '3':
        try:
            print '[>] Please waiting ... \n'
            past_tweet = api.GetUserTimeline()
            for i in past_tweet:
            print '''==================================
          by RR12            
Created at   : %s
Tweet        : %s
            
                ''' %(i.created_at, i.text)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show your tweet !'
        sys.exit('[>] Exit !')
        
    elif option == '4':
        try:
        print '[>] Please waiting ... \n'
        friends = api.GetFriendsTimeline()
        for i in friends:
                print '''==================================
          by RR12            
Username       : %s
Tweet        : %s
Created at    : %s
            
                ''' %(i.user.name, i.text, i.relative_created_at)
            time.sleep(2)
            
        except:
        print '[>] There\'s something wrong, bro !! failed to show lastest tweet !'
        sys.exit('[>] Exit !')
    
    elif option == '5':
        try:
        print '[>] Please waiting ... \n'
        mentions = api.GetReplies()
        for i in mentions:
            print '''==================================
          by RR12            
Username       : %s
Created at    : %s
Tweet        : %s
            
            ''' %(i.user.name, i.created_at, i.text)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show your post replies (MENTIONS) !'
        sys.exit('[>] Exit !')
    
    elif option in ('X', 'x', 'Exit', 'exit'):
        sys.exit('\n[+] Thank you, bro !! \n\n[*]Exit')    
        
    else:
        sys.exit('\n[*] Wrong choice, bro !! \n\n[*]Exit')
    

if __name__=='__main__':
    lagi = 'y'
    while lagi in ('y','Y','Yes', 'YES'):
        starter()
    lagi = raw_input('[>] Do you want to user this app again ? ')
    
    sys.exit('\n[+] Thank you, bro !! \n\n[*]Exit')

maksudnya buat file .py baru make yg isinya script itu yah? tp kok error om
Code:
root@bt:~# python jacktwit.py
  File "jacktwit.py", line 55
    status_update = raw_input(' [>] What\'s happening? ')
                ^
IndentationError: expected an indented block
sorry nih om kebanyakan nanya, pengguna baru bgt om.. hehe

itu masalah tab/spasi nya yg gug beres jadi nya blok code programnya kacau. hehehhe
sy juga gug tau kok masih gitu, padahal dah pke tag CODE, n langsung copas dari editor, so copas dari sini aja lah om http://www.rr12.webatu.com/tools/RRTwitter.py .
udah sy test, insyallah work .. ehhehehe
@nyelonong :
oufhh itu masalah TAB/SPASI nya yg gug bener, jadi blok code programnya kacau deh ! hehehe. sy juga gug tau kok gitu padahal dah pake tag CODE n langsung copas dari EDITOR, tapi masih kyk gitu ..
ke SINI aja om, udah sy test and insyaallah work. hehehhe

#13
(11-12-2011, 01:38 AM)RR12 Wrote: yg diedit cukup di bagian script saya !! edit sesuaikan dengan costumer key, dll yg om udah dapet dari twitter !!!

Nah itu yang saya tanyakan om Smile
Bagian script apa yang harus saya edit?
Nama filenya maksudnya..
kan ada setup.py twitter.py, setup.cfg, twitter_test.py dll
file mana yang harus di edit?
Yang putih, yang seharusnya ber-aksi dan berbakat!
Linuxtivist blog

#14
(11-12-2011, 01:40 AM)nyelonong Wrote:
(11-12-2011, 01:11 AM)RR12 Wrote: @nyelonong
wadduuuhh itu kan scriptnya ada diatas om !! ehehehhe
ini loh ..

Code:
import twitter
import sys
import time
import os

costumer_key = 'sesuaikan dengan key anda n tetap pake tanda petik'
costumer_secret = 'sesuaikan dengan key anda n tetap pake tanda petik'
access_token = 'sesuaikan dengan key anda n tetap pake tanda petik'
access_token_secret = 'sesuaikan dengan key anda n tetap pake tanda petik'

#example
#costumer_key = 'NQMPxdgVMAJGe1b2g3h4j'
#costumer_secret = 'WhBNeJaeWG4eypSclU2tVbIGdkeoo41b2g3f4h5f'
#access_token = '126010565-2q4e9njh7dblYNmpEm3hQ1lbT1M17NwaSAgEvrr'
#access_token_secret = '2q4e9njh7dbHO004GPv2f9OqA97FRw3DxaX5BET4A'

api = twitter.Api(consumer_key=costumer_key,consumer_secret=costumer_secret, access_token_key=access_token, access_token_secret=access_token_secret)

def starter():
    if os.name == 'posix':
        os.system('clear')
    else:
        os.system('cls')
    info = '''
_            _ _   _            
| |___      _(_) |_| |_ ___ _ __
| __\ \ /\ / / | __| __/ _ \ '__|
| |_ \ V  V /| | |_| ||  __/ |  
\__| \_/\_/ |_|\__|\__\___|_|     Client Apps
                                   by RR12
                                   [email protected]
                                   http://khairil12.blogspot.com
                                

[1] Tweet something
[2] Show your following list
[3] Show your past tweet
[4] Show the newest tweet
[5] Show tweets who mention you
[6] Follow someone
[X] X for Exit

\n
'''
    for i in info:
        print '\b%s' %(i),
        sys.stdout.flush()
        time.sleep(0.005)

    choice = raw_input('[>] Please input your choice : ')
    main(choice)

def main(option=None):
    if option == '1':
        try:
        status_update = raw_input('[>] What\'s happening? ')
        print '[>] Please waiting ... \n'
        api.PostUpdate(status_update)
        print '[>] Your tweet has benn updated >> \"%s\"' %(status_update)
        except:
        print '[>] There\'s something wrong, bro !! failed to tweet !'
        sys.exit('[>] Exit !')
        
    elif option == '6':
        try:
        follow = raw_input('[>] Please input a username that will follow : ')
        print '[>] Please waiting ... \n'
        api.CreateFriendship(follow)
        print '[>] You have following >> %s !"' %(follow)
        except:
        print '[>] There\'s something wrong, bro !! failed to follow !'
        sys.exit('[>] Exit !')
    
    elif option == '2':
        try:
        print '[>] Please waiting ... \n'
        friends = api.GetFriends()
        for i in friends:
            print '''==================================
          by RR12            
ID           : %s
Name         : %s
Location     : %s
Created at   : %s
Description  : %s
            
            ''' %(i.id, i.name, i.location, i.created_at, i.description)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show the friend list !'
        sys.exit('[>] Exit !')

    elif option == '3':
        try:
            print '[>] Please waiting ... \n'
            past_tweet = api.GetUserTimeline()
            for i in past_tweet:
            print '''==================================
          by RR12            
Created at   : %s
Tweet        : %s
            
                ''' %(i.created_at, i.text)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show your tweet !'
        sys.exit('[>] Exit !')
        
    elif option == '4':
        try:
        print '[>] Please waiting ... \n'
        friends = api.GetFriendsTimeline()
        for i in friends:
                print '''==================================
          by RR12            
Username       : %s
Tweet        : %s
Created at    : %s
            
                ''' %(i.user.name, i.text, i.relative_created_at)
            time.sleep(2)
            
        except:
        print '[>] There\'s something wrong, bro !! failed to show lastest tweet !'
        sys.exit('[>] Exit !')
    
    elif option == '5':
        try:
        print '[>] Please waiting ... \n'
        mentions = api.GetReplies()
        for i in mentions:
            print '''==================================
          by RR12            
Username       : %s
Created at    : %s
Tweet        : %s
            
            ''' %(i.user.name, i.created_at, i.text)
            time.sleep(2)
        except:
        print '[>] There\'s something wrong, bro !! failed to show your post replies (MENTIONS) !'
        sys.exit('[>] Exit !')
    
    elif option in ('X', 'x', 'Exit', 'exit'):
        sys.exit('\n[+] Thank you, bro !! \n\n[*]Exit')    
        
    else:
        sys.exit('\n[*] Wrong choice, bro !! \n\n[*]Exit')
    

if __name__=='__main__':
    lagi = 'y'
    while lagi in ('y','Y','Yes', 'YES'):
        starter()
    lagi = raw_input('[>] Do you want to user this app again ? ')
    
    sys.exit('\n[+] Thank you, bro !! \n\n[*]Exit')

maksudnya buat file .py baru make yg isinya script itu yah? tp kok error om
Code:
root@bt:~# python jacktwit.py
  File "jacktwit.py", line 55
    status_update = raw_input(' [>] What\'s happening? ')
                ^
IndentationError: expected an indented block
sorry nih om kebanyakan nanya, pengguna baru bgt om.. hehe


ok om gug apa2, setelah sy lihat ternyata memang TAB/SPASI di script yg sy post diatas agak kacau, jadi ada beberapa blok code programnya yg kacau. hehehhehe,
mending copas scriptnya dari link ini om
Code:
http://www.rr12.webatu.com/tools/RRTwitter.py
udah ane test yg itu, insyaallah work.. eheh Smile
(11-12-2011, 09:54 AM)THJC Wrote:
(11-12-2011, 01:38 AM)RR12 Wrote: yg diedit cukup di bagian script saya !! edit sesuaikan dengan costumer key, dll yg om udah dapet dari twitter !!!

Nah itu yang saya tanyakan om Smile
Bagian script apa yang harus saya edit?
Nama filenya maksudnya..
kan ada setup.py twitter.py, setup.cfg, twitter_test.py dll
file mana yang harus di edit?

ok om THJC, gug ada yg diedit di dalam folder python_twitternya (setup.py twitter.py, setup.cfg, twitter_test.py dll) om.. yg diedit cuman script yg sy buat itu om. dibagian ini :

Code:
costumer_key = 'Change with yours'
costumer_secret = 'Change with yours'
access_token = 'Change with yours'
access_token_secret = 'Change with yours'

isi sesuai dengan yg om dapat dari twitter. itu aja om yg diedit, gug ada lagi, okok Smile

_______________________________________________________
script yg benar/work bisa didapat di sini

#15
makasih kk, work scriptnya Angry

#16
(11-12-2011, 03:57 PM)keda Wrote: makasih kk, work scriptnya Angry

ALhamdulillah kalo gitu .. hehehehhe , thanks dah dicobain om ..

#17
sip udah bisa, makasih banyak om Smile

#18
(11-12-2011, 05:44 PM)nyelonong Wrote: sip udah bisa, makasih banyak om Smile

wahh seriuss neh .... hehehhe okok lah om .. thanks ! Smile

#19
Nah, work om Smile
tapi pas mau twit, gabisa...


Quote:[>] Please input your choice : 1
[>] What's happening? Smile
[>] Please waiting ...

[>] There's something wrong, bro !! failed to tweet !
[>] Exit !
deprito@WindwetaAyu:~/Downloads$
Yang putih, yang seharusnya ber-aksi dan berbakat!
Linuxtivist blog

#20
(11-12-2011, 07:39 PM)THJC Wrote: Nah, work om Smile
tapi pas mau twit, gabisa...


Quote:[>] Please input your choice : 1
[>] What's happening? Smile
[>] Please waiting ...

[>] There's something wrong, bro !! failed to tweet !
[>] Exit !
deprito@WindwetaAyu:~/Downloads$

biasanya itu klo masalah jaringannya om.. tapi klo terus2an kyk gitu berarti mank gug beres ... hehehhe Smile






Users browsing this thread: 1 Guest(s)