Post News to Twitter from NetNewsWire

Kembali lagi mengenai NetNewsWire yang telah AMC bahas sebelumnya. kali ini AMC coba membahas salah satu fungsi dari NetNewsWire, yaitu posting ke Twitter Account – hal ini sangat penting sekali kalau sobat AMC ingin membagi informasi yang sedang di baca tanpa perlu disibukkan kopi dan paste ke website jejaring sosial.

download script TwitNews, ekstrak dan lettakkan script tersebut di dalam :

~/Library/Application Support/NetNewsWire/Scripts

yang terpenting disini, script ini akan meminta password dan login twitter sobat melalui KeyChain Access Application, jika belum tersimpan, buka twitter dengan safari dan simpan password twitter sobat, atau sobat bisa langsung mengakses melalui keychain app dan menambahkan  Keychain name : twitter.com juga isikan account name dan password dengan login twitter.

berikut isi scriptnya dari web sumber twitnews :

?Download twitnews.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
tell application "NetNewsWire"
if index of selected tab = 0 then
-- We're looking at headlines, so just get the headline URL
set feed_url to URL of selectedHeadline
set feed_title to title of selectedHeadline
else
-- We're looking at a web view tab, so we need to know which tab
set i to index of selected tab
set i to i + 1
-- Get the tab's URL
set URL_list to URLs of tabs
set title_list to titles of tabs
set feed_url to item i of URL_list
set feed_title to item i of title_list
end if
-- Build the GET request for the is.gd API
set feed_url to "http://is.gd/api.php?longurl=" & feed_url
-- Submit the GET request and copy the results to clipboard
set cmd to "curl " & feed_url
set feed_url to (do shell script cmd)
end tell
 
-- change the status message to your liking here:
set tweet to feed_title & " " & feed_url
 
-- let the user edit
display dialog "Edit your Twitter status" with title "TwitNews" default answer tweet cancel button 1 default button 2 buttons {"Cancel", "Send"}
set tweet to (text returned of result)
 
-- get login from keychain
tell application "Keychain Scripting"
set twitter_key to first Internet key of current keychain whose server is "twitter.com"
set twitter_login to quoted form of (account of twitter_key & ":" & password of twitter_key)
end tell
 
-- post to twitter
set twitter_status to quoted form of ("status=" & tweet)
set results to do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json"

Bagi sobat AMC yang kesusahan mengakses ke Keychain app – harus nya sih lebih gampang – bisa mencoba cara berikut :

dari script hapus:

?View Code LANGUAGE
30
31
32
33
34
– get login from keychain
tell application “Keychain Scripting”
set twitter_key to first Internet key of current keychain whose server is “twitter.com”
set twitter_login to quoted form of (account of twitter_key & “:” & password of twitter_key)
end tell

di ganti dengan script berikut :

?View Code LANGUAGE
30
31
32
33
– Set Twitter username and password
set twitter_username to “enter_your_twitter_username”
set twitter_password to “enter_your_twitter_password”
set twitter_login to quoted form of (twitter_username & “:” & twitter_password)

Popularity: 6% [?]

Related posts:

  1. NetNewsWire NetNewsWire merupakan Aplikasi Desktop untuk MAC OS X yang berfungsi...
  2. Facebook Chat dengan iChat Hari genee belum kenal Facebook ? situs ini menawarkan penggunanya...
  3. Apache Tomcat di MAC OS X Menginstall Apache Tomcat di MAC OS X sangatlah mudah, hanya...
  4. HSDPA IM2 Mac Os Bagi Sobat AMC yang memiliki kendala yang sama dengan kami...

About avudz

Sehari sehari menggunakan MacBook Unibody, Web Dev Aceh Mac Club, Menyandang sertifikat International seperti Cisco Certified Network Assosiate (CCNA) dan Red Hat Certified Technician (RHCT). Berpengalaman bekerja sebagai Engineer di beberapa Perusahaan, pernah membantu Aceh dalam Rehab & Rekon setelah tsunami. saat ini sedang mengejar gelar magister teknologi informasi di UGM. info detail liat blog avudz....

Leave a comment

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Your email is never shared. Required fields are marked *