guys, i already trying to figure out, where is the problem and fixed
it,
now the code :
/*
  public void processEvents(RobotMessageBundle events) {

                Wavelet wavelet = events.getWavelet();

                if (events.wasSelfAdded()) {
                  Blip blip = wavelet.appendBlip();
                  TextView textView = blip.getDocument();
                  textView.append("yitmebot is here.");
                }

                List<Event> submittedEvents = events.getBlipSubmittedEvents
();
                for (Event e : submittedEvents) {
                  Blip blip = e.getBlip();
                  TextView textView = blip.getDocument();

                  try {
                                replaceurl(textView);
                        } catch (JSONException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        } catch (IOException e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
                }
              }


             void replaceurl(TextView textView) throws JSONException,
IOException {

                String text = textView.getText();
                Pattern yitmeurl = Pattern.compile(URLregex, Pattern.DOTALL);
                 Matcher matcher = yitmeurl.matcher(text);

                longurl = yitmeapi+text;

                URLEncoder.encode(longurl, "UTF-8");

                while (matcher.find()) {

                fetchUrl(longurl);

                textView.replace(longurl);

                }}
*/
the output:

http://yit.me/d62chd

as u can see at screenshot above, the fetch url still didn't execute
the api.php

anyone ?

On Nov 24, 5:35 pm, DAMNiaTX <[email protected]> wrote:
> Hello,
> i need help to developing bot, i already try to fiqure out my problem,
> but still i can't fix it.
>
> this is the code
> //
>  if (robotMessageBundle.wasSelfAdded()) {
>             Blip blip = wavelet.appendBlip();
>              TextView textView = blip.getDocument();
>             textView.append("Hi Anyone, let me shorten your 
> url.http://yit.me/2/multifl0w.deb";);
>                                         }
>
>             for (Event event: robotMessageBundle.getBlipSubmittedEvents()) {
>                                    Blip blip = event.getBlip();
>                           TextView textView = blip.getDocument();
>                           String message = null;
>                           textView.replace(message);
>                            // String message = blip.getDocument().getText();
>                             Pattern pattern = Pattern.compile(URLregex,
> Pattern.DOTALL);
>                                         Matcher matcher = 
> pattern.matcher(message);
>
>                                         while (matcher.find()) {
>                                                 String longurl = 
> matcher.group(1);
>
>                                 YitmeURL(longurl, message);
>
>                                 textView.append("shorturl:" +longurl);
>
>                         }
>
> //
>
> first code  if (robotMessageBundle.wasSelfAdded()) already correct,
> but second code (for **) it doesn't run. i don't know where is the
> problem, can some one help me to give some information to fix it.
>
> basicly in second code, bot will add new wavelet with short url under
> bot name every url entered in any wavelet.
>
> Thanks

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to