streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbnks <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 115
Date Mon, 14 Jul 2014 19:39:48 GMT
Github user rbnks commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/51#discussion_r14898741
  
    --- Diff: streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
---
    @@ -291,15 +262,55 @@ public void prepare(Object o) {
             Preconditions.checkNotNull(config.getOauth().getConsumerSecret());
             Preconditions.checkNotNull(config.getOauth().getAccessToken());
             Preconditions.checkNotNull(config.getOauth().getAccessTokenSecret());
    -        Preconditions.checkNotNull(config.getFollow());
    +        Preconditions.checkNotNull(config.getInfo());
    +
    +        List<String> screenNames = new ArrayList<String>();
    +        List<String[]> screenNameBatches = new ArrayList<String[]>();
    +
    +        List<Long> ids = new ArrayList<Long>();
    +        List<Long[]> idsBatches = new ArrayList<Long[]>();
    +
    +        for(String s : config.getInfo()) {
    +            if(s != null)
    +            {
    +                String potentialScreenName = s.replaceAll("@", "").trim().toLowerCase();
    +
    +                // See if it is a long, if it is, add it to the user iD list, if it is
not, add it to the
    +                // screen name list
    +                try {
    +                    ids.add(Long.parseLong(potentialScreenName));
    +                } catch (Exception e) {
    --- End diff --
    
    Exception should be NumberFormatException


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message