Below is the part of the assignment that I coded for tonight:
"Write an application that will ask a person for their Twitter login and password, then displays a list of people that person follows by Twitter ID, their status and the date of their status..."
import winterwell.jtwitter.*;
import java.awt.*;
import javax.swing.*;
public class TwitterAppOne {
SinglyLinkedList myList;
public TwitterAppOne() {
myList = new SinglyLinkedList();
}
public static void main(String[] args) {
JFrame = frame = new JFrame("Twitter");
JButton button = new JButton("Sign In");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String id = JOptionPane.showInputDialog("Username");
String pw = JOptionPane.showInputDialog("Password");
)}
}
JPanel panel = new JPanel();
panel.add(button);
frame.add(panel);
frame.setSize(300, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
Twitter twitter;
twitter = new Twitter(id, pw);
friendCount = twitter.getFriendIDs(id).size();
friends = new User[myFriendsCount];
int x = 1;
for(int i = 0; i < myFriendsCount; i++) {
String id = friends[i].getScreenName();
String status = friends[i].getStatus();
//How to get date of each status update?
System.out.println("FOLLOWER NUMBER: " + x);
System.out.println("ID: " + id);
System.out.println("STATUS: " + status);
System.out.println("DATE OF STATUS: "); //Fix this later.
System.out.println("-----------------------------------------");
x++;
}
//Will the below do the whole for-loop above all at once?
twitter.getUserDetail(id);
}
This post has been edited by mattlyons: 03 March 2010 - 02:14 AM

New Topic/Question
Reply




MultiQuote







|