Permalink
Browse files

More house keeping, will create a bot shortly.

  • Loading branch information...
1 parent 6b6773d commit a522d1148e5486afc55264a07309d8fdecff9970 @baphled committed Dec 7, 2008
Showing with 13 additions and 12 deletions.
  1. +5 −4 twitterl.erl
  2. +8 −8 twitterl_interface.erl
View
@@ -109,9 +109,9 @@ find_tweets(Login, _Password, Args) ->
find_term(_Login, _Password, Args) ->
twitterl_interface:term(Args).
-public_timeline(_Login, _Password, _Args) ->
+tweet_timeline(_Login, _Password, _Args) ->
twitterl_interface:public_timeline().
-user_timeline(Login, _Password, _Args) ->
+my_timeline(Login, _Password, _Args) ->
twitterl_interface:user_timeline(Login).
%% These methods will return more detailed information
@@ -120,7 +120,8 @@ user_followers(Login, Password, _Args) ->
twitterl_interface:handle_status(followers, Login, Password).
user_friends(Login, Password, _Args) ->
twitterl_interface:handle_status(friends, Login, Password).
-status_user_timeline(Login, Password, _Args) ->
+user_timeline(Login, Password, _Args) ->
twitterl_interface:handle_status(user_timeline, Login, Password).
-
+public_timeline(Login, Password, _Args) ->
+ twitterl_interface:handle_status(public_timeline, Login, Password).
View
@@ -158,7 +158,7 @@ auth_user(Login, Password) ->
%% Methods to retrieve user based information.
-%%% Handles each status
+%%% Handles each of our user & status requests
%@private
handle_status(Type,User,Pass) ->
case Type of
@@ -249,17 +249,17 @@ parse_status(Node) when is_tuple(Node)->
favorited = format_text(Node, ["/status/favourited/text()"],"")
},
case xmerl_xpath:string("/status/user", Node) of
- [] -> Result;
+ [] -> Status;
[User] -> Status#status{ user = parse_user(User) }
end.
-parse_item(Item) ->
- Result = #tweet {
- title = format_text(Item, ["/item/title/text()"],""),
- pubDate = format_text(Item, ["/item/pubDate/text()"],""),
- link = format_text(Item, ["/item/link/text()"], "")
+parse_item(Node) ->
+ Item = #tweet {
+ title = format_text(Node, ["/item/title/text()"],""),
+ pubDate = format_text(Node, ["/item/pubDate/text()"],""),
+ link = format_text(Node, ["/item/link/text()"], "")
},
- Result.
+ Item.
%%% Parses our user information.
%%% Should really find a better way of doing this, we repeating ourselves

0 comments on commit a522d11

Please sign in to comment.