Username: Password:

Author Topic: Edit XML  (Read 32675 times)

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #15 on: May 05, 2010, 09:42:25 am »
i  am now using operation"sum" in site  "http://freesms4.us/index.php"
the captcha is simple the sum of two numbers
second number is between "+" and "="
but for first number i don't know how to search that

The first number is between "<td>" and "+" symbol...but you should use a regular expression to extract both values in one go, or you get much mess for the first one with a "between" search.


I Think  i saw onle xml file in your site which had used Mobile number without "+" sign,
i am not sure it was $recpt_noplus"
i'll view all of the xml file to check again
Maybe there is a service that has a variable named that way, but it is not a system variable, it was calculated as I said some posts above (with a replace or substring operation).

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #16 on: May 06, 2010, 01:10:26 pm »
For "http://freesms4.us/index.php" i tried to search between"" and "+"
with different spaces inside "" but not success to see first number

As said this is a case where regular expressions are nearly mandatory.

Use this var tag to extract the 2 terms of the sum operation:

Code: [Select]
<var in="page" name="sum_term" search="regex" regex="&lt;td&gt;([0-9]+) \+ ([0-9]+) =" />
after this tag you will have two variables named "$sum_term1" and "$sum_term2", with the two values.
Ok?

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #17 on: May 07, 2010, 07:06:46 pm »
I'm going to add support for this in the next release, but I'm still thinking on how to handle it best without impacting performance.

I think I should be able to provide a workaround that works in the current release...I'll post here those infos as soon as possible.

Hi, I checked and I'm really sorry but I can't provide you a workaround because of a little mistake I made in the code that should speed up charset handling (and that I hoped could help us here).

You will have to wait for version 0.9.1, which is not due to be released before some weeks.

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #18 on: May 09, 2010, 07:19:36 pm »
Sorry I can't explain here how regex (short for "Regular Expressions") because it is not my invention, it is a fantastic and incredibly powerful way to validate and extract text from strings.

I've spent quite some time to understand and use them properly, and I'm still using only part of their power.

It suggest you to search the internet for some introductions or basic guides to regular expressions (or regex), and read the guide you find more understandable for you.

By the way it is a quite advanced topic, which is not always needed for writing xml services (but usually helps you to write things in less steps and/or better).

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #19 on: May 20, 2010, 02:55:10 pm »
I have Problem to use captcha
I have used in xml file but system asking for captcha code several times
i have attached the xml file

It is really easy, you simply need to put a <fork><condition> at the start of the service, to jump after the <captcha> tag if the user sends the code (that is if $img_code is not empty).

I've made 3 other minor changes:
  • I've fixed the service icon (you always forget to change it)
  • You wrote "Unlimited" in the <limit quantity=""> but you can only use numbers there. If you want to make it unlimited you need to write quantity="0" and type="num".
    Are you sure that this service offers unlimited messages anyway?!
  • I've added some <save> tags inside the <captcha> one: they are not used right now in goText++ Desk! but will be needed to make xml services with captcha work inside the goText 3 midlet

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #20 on: May 21, 2010, 07:52:28 am »
Ahah, sorry, I forgot you needed to also add the savesession="true" attribute in the starting <service> tag.
It should work now.
Please report back the results.

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #21 on: May 24, 2010, 07:56:48 am »
Thank You Zydio,
It worked
But every time i see same captcha code "May be because of save option"
it sends sms and there is no problem , thank you very much
Sorry I can't understand the problem you are talking about. Can you please explain it better?

Anyway as I've already said the <save> tags right now do nothing. I've added them because they'll be necessary to make the script work with the future goText 3 midlet.

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #22 on: May 25, 2010, 10:45:18 am »
I mean when i send several sms's from same service i see the same captha code
for example if first time the captcha code is "3109" and i send 2nd sms i see the same code "3109"
it is working for now
but if the web site is not working with old captcha code it will have problem
i think when i send more than one sms, the service is not loading the captcha url again and it uses last captcha code
There was a mix of problems:

  • You didn't flag the login pages as such (login="true")
  • There should be a check to test if the session is valid (I've added a <fork> named "session_validity_check" )
  • There should be a jump to that check if the session is available, to skip the login (I've added a <fork> named "captcha_check" )

Please check the updated service and see if it works.

I have problem to use search some special characters like as"<" in html
what is solution for this?
You can search whatever character you want, the only limit is that XML don't directly accept some characters in strings. But you can use them anyway using the corresponding html entities:

  • ">" should be changed with the entity "&gt;" (greater than)
  • "<" should be changed with the entity "&lt;" (less than)
  • "&" should be changed with the entity "&amp;"

Ok?

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #23 on: May 25, 2010, 01:02:26 pm »
thank you about search items
and for Freindz xml file, i tested it, for second sms sending it canceled the captcha entring, but sending of sms failed,
may be login has been expired

Sorry I made a mistake, please try again with the new attachment

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #24 on: May 27, 2010, 08:57:11 am »
Dear Zydio,
I tested the script,
the procedure is ok
the first sms is sending
but for second one which bypassing login section, the variable "recipient" is blank
it means it is not saved,
i don't know what is wrong, the other variables have content
Oh yes, that's right! This is what happens when I can't test a service ;) ..On the second recipient I made it jump to "credit" step, and the step "1" was not executed: the $rcpt_noplus was being calculated only in this step! I duplicated the $rcpt_noplus var in the "credit" step, your problem should be gone.

I've also indented the code better, it was almost impossible to distinguish the steps at a first sight!

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #25 on: May 28, 2010, 02:47:41 pm »
Zydio it didn't work but no problem, i'll use your first script which for any sms needs captcha code
What problem is left?

I have other question, is there iny option like "notallowed_ccc" because some sites supporting all countries exept few countries
There is no such option right now. Usually websites provide a list of supported countries, what website provide a list of unsupported countries?
If there is the need of a such option I'll add this request in my "to do list", and I'll try to do it in the next version.

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Edit XML
« Reply #26 on: May 28, 2010, 03:31:17 pm »
For example O2-Ireland is not supporting my country "IRAN"
In fact if you read O2 Ireland Xml Service the +98 country code is not in the list, I've listed only the supported countries (which were available somewhere in the sms page sourcecode), and you can't send messages with goText++ Desk! to iran.

The Script says error, to fix that i should understand meaning of session and to use condition
$session gets a value only if:
  • You have set the savesession="true" attribute in <service> tag

and it has a value (is not empty) when:
  • The execution reaches a <captcha> tag
  • You have sent a message previously with that service and you reached the <captcha> tag

When $session has a value (is not empty), it means that the cookies for that website are restored on your next send (of a message, or a captcha text of an ongoing send): this allows you to continue the execution after a captcha, or skip the captcha step until the session is valid (the latter is possible only on some websites, where the captcha is on a login page).

<fork> and <condition> are fairly easy to use, you only need to read what kind of conditions you can use or see samples (because this tags are pretty self explaining).

terrence909

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Edit XML
« Reply #27 on: December 23, 2010, 09:56:58 am »
I want know that how to add XML file within dataset???

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Edit XML
« Reply #28 on: December 23, 2010, 01:43:02 pm »
I want know that how to add XML file within dataset???

Just download the Desktop version of goText and add the xml address in the service part