mbfishman / java-twitter

Automatically exported from code.google.com/p/java-twitter
Apache License 2.0
0 stars 0 forks source link

Ability to pass username parameter #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was not able to find a way to pass a "from username" parameter to a
SearchRequest.Builder object (actual Twitter format is "from=<username>". I
checked out the source and created a new method, similar to the .page
method, which appends a parameter to the URL as above. I tested to the best
of my ability (the new method appears to have worked, and didn't appear to
have broken anything). Here's the patch if you'd like to check it back in
to the code:

### Eclipse Workspace Patch 1.0
#P java-twitter
Index: src/main/java/net/unto/twitter/methods/SearchRequest.java
===================================================================
--- src/main/java/net/unto/twitter/methods/SearchRequest.java   (revision 157)
+++ src/main/java/net/unto/twitter/methods/SearchRequest.java   (working copy)
@@ -69,6 +69,16 @@
       assert (page >= 1);
       return parameter("page", Integer.toString(page));
     }
+    
+   
/**************************************************************************
+     * The originating user name whose results to retrieve.
+     * @param UserName The Twitter user name.
+     * @return Builder
+     */
+    public Builder fromuser(String UserName) {
+      assert (UserName.length() > 0);
+      return parameter("from",UserName);
+    }

     public Builder geocode(Geocode geocode) {
       return parameter("geocode", String.format("%s,%s,%s%s", geocode

Thanks,
Josh

Original issue reported on code.google.com by yardbird...@gmail.com on 24 Jul 2009 at 4:38

GoogleCodeExporter commented 9 years ago
Fixed in r158.  Please verify.

Original comment by dclinton on 26 Jul 2009 at 3:11