goText Forums

International Forums => Xml Services => Topic started by: Mip104 on May 09, 2010, 11:44:01 am

Title: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 09, 2010, 11:44:01 am
Zydio , I have already finished with 3 XML scripts: free, 15 credit and 35 credit SMS XML scripts, if they are worthy to share, let me know to create a similar XML topics for them :)
This is because I have a good tutor in XML scripting alike you Zydio :) Thanks for your helps
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 09, 2010, 07:23:16 pm
Are you kidding? I'm really looking forward to your xml services for Kostenlos!!
They work fine? Have you added error checks (eg: wrong login, sms sent/not sent, ..?). If so please create a new thread that will become the official thread for those services with all the infos on Sms-Kostenlos, and what differs from the 3 services/modes.
Attach here or in the new thread the services: I'll review them, improve or merge them if there is room for improvement, and I'll publish them officially for all users in our SVN and Xml Services page.
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 09, 2010, 07:40:16 pm
I am not kidding :) they are all working :) you can check them if anything is missed please add. I am really happy with these as I have all learned from you. I do appreciate it
I already made two seperate topics, one is for free mode and the other for credit based modes
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 10, 2010, 08:40:48 am
Hi mip, I've seen your services.
Well done!
There is room for improvement though.

I'll publish those services officially once you tested my edits and we've added credit synchronization.

PPS: I know that between the 35 credits and 15 credits changes the max number of chars, but I felt like it was a good compromise to set the limit to the lower one to merge the services into one.

PPS:
I am really happy with these as I have all learned from you. I do appreciate it
I already made two seperate topics, one is for free mode and the other for credit based modes
I'm happy too to see when users start to get involved into the project.
And I'm happy to see that my idea of a powerful xml service format simple enough to be used from common users to make services really works  :) :)
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 08:52:47 am
Thanks Zydio, It seems great by your changes :) I will check them as soon as possible and I got credits ;)
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 09:57:44 am
common users to make services really works  :) :)
May be I am not so common ;)

The available credits are shows at the first page on the top-left part or also in the middle part

<strong>30 Credits</strong>
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 10, 2010, 10:28:12 am
Oh that's right, sorry :P

Here is the updated service with credit based count, and credit sync with the website.
I've also added two steps to check if the credit is enough to send the message. I've a doubt on this: if you send 200 chars (2 real sms) with your number as id it charges you 35 credits or 70 (35 * 2)?

I also swapped the 35 and 15 modes previously.

I've also added the logout page.

Can you please check if they work fine?
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 10, 2010, 10:38:28 am
(I'm uploading again the "no ads" script as it contained a minor typo)
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 10:39:57 am
I've a doubt on this: if you send 200 chars (2 real sms) with your number as id it charges you 35 credits or 70 (35 * 2)?
Yes if it just increased by 1 character meaning 160 get 161 it will change to 70 credits
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 10:44:45 am
Thanks for the new changes, they were really needed. Sorry I didn;t took them in to consideration, because I was just looking for how it is working! The free one is OK,but for the credit based just wait until tomorrow so I can check it, it also checks how many sms per day is remained based on the site :) Great
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 10:50:54 am
in Free one there is one problem in showing the sms remained, it should be [/d]-1 :) because while it reads it is for example 3 sms remained after that it should be 2 but it shows the previous number
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 10, 2010, 10:58:33 am
I've a doubt on this: if you send 200 chars (2 real sms) with your number as id it charges you 35 credits or 70 (35 * 2)?
Yes if it just increased by 1 character meaning 160 get 161 it will change to 70 credits
Ok, I've update the service again to deal with this (I've changed the checks for credit).

For the free one: the freesms page shows the number of remaining free messages or not? Is it only shown on the homepage? We have to add another tag to update $sms_rem_1 after the message is sent.
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 11:01:08 am
Yes it just shows at the first page (home page) a tag back again to the first page before logout is needed
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 10, 2010, 11:05:15 am
Yes it just shows at the first page (home page) a tag back again to the first page before logout is needed
Ok, please try this updated script
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 11:08:59 am
Just run out of freeSMS :) But it worked while I made this change. I will check all your changes tomorrow
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 10, 2010, 11:16:06 am
It seems I just put one more line which is not needed. So are the same :)
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 11, 2010, 05:37:36 am
Even if there is 15 credits, it says , not enough credit for 15 credit and the same is for 35 credit, the freeSMS is OK, Reply #7 is working fine for 15 credit but it seems something is wrong with 35 credit, I have to check it after I got 35 credits, it may be something refers to sms[from] value that is constant in 15 credit but in 35 credit can vary between 3 values :) I thought both might go the same in this manner that, their first value will be selected as default but this seems not assigned to the 35 credit, I will check it in few days

Zydio, I am sorry that I didn't take this issue in consideration before :(
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 11, 2010, 07:04:58 am
I have updated to this one that works with 15 credit but I need more credits to check the 35 one, just 2 codes are added
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 11, 2010, 07:57:32 am
You were not using my latest version, maybe that's why it said not enough credit even if you had 15 credits.
Or maybe because you have to check again the service config, I have inverted the two modes and your config data maybe swapped now.

I've integrated your changes with my latest credit checking steps.

Please try again when you have more credits, also to test if your change fixes the problem of the changing field.
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 11, 2010, 08:20:45 am
I used the post #11 attachment which had that problem, but it was ok with the attachment of post #7, Ok thanks for the update. I will check it in following days :)

About the 15 credit, the new script is OK now, I have to check for 35 credits the following days to see whether the problem is resolved or not ...

This is the Final Lap as is told in car racing ;)
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 07:42:18 am
Zydio, that change will not work for the usernames which have registered the mobile number, today I get the credits and the source page is like this:

<select class="field" name="sms[from]" id="frmTextSMSFromSelect">
<option value="smskostnlos" >smskostnlos</option>

<option value="+XXXXXXXXXX" selected="selected">+XXXXXXXXXX</option>
<option value="custom">frei wählbar&hellip;</option>
</select>

When the 15 credit is selected, sender will be disabled to "smskostenlos"
When 35 credit is selectedm sender will have choices but the default choice is "+XXXXXXXXXX" the mobile number!

That's why I didn't consider it, because I thought in 15 credit it will be locked on "smskosetenlos" and in 35 credit the default is the sender's number!
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 07:44:53 am
In this case , does the name="sms[from]" take its value from the options? additionally "<" is not supported to be searched in XML... If so, I think this should also be defined at first when the credits 15 or 35 are being selected
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 12, 2010, 09:49:05 am
In this case , does the name="sms[from]" take its value from the options? additionally "<" is not supported to be searched in XML... If so, I think this should also be defined at first when the credits 15 or 35 are being selected

In this case , does the name="sms[from]" take its value from the options? additionally "<" is not supported to be searched in XML... If so, I think this should also be defined at first when the credits 15 or 35 are being selected
The select sends the value of the <option> the user selects.
That is, the select you pasted can post one of the following three bits of data:

And you can search "<" char, you only need to replace it with its equivalent entity, that is "&lt;"..

With your infos I've updated the service once again, also fixing a problem with the credit check for 15 credits messages (there was a problem indeed).

I've only a doubt left: you said the value="+XXXXXXXXX" is the option to set your number as sender, which costs 35 credits, is this right?
value="smskostenlos" is the 15 credits mode...but..what is the value="custom" mode?!?!?
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 12:05:09 pm
Thanks Zydio, really you have done all things now :)
Yes that is right "+XXXXXXXXXX" is the number that you have registered in site which can be used for 35 credit, because in 35 credit you have options between these three "Smskostnlos", "+XXXXXXXXX", and "custom". I have never used the custom, may be that is there for who that has registered for many numbers. because while I chose custom the box gets cleaned, so one can type something there.
But in 15 Credit the sender part is locked on "smskosetnlos"
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 12:30:34 pm
This part makes it not working, jumps to logout, I deleted it :)

    <fork id="sender_check">
      <condition type="empty" var1="$sender" ko_error="$L_ERROR_GENERIC" />
    </fork>

It had a typo too, I changed it to "smskostnlos"

      <var in="page" name="sender" search="regex" regex='option value="(\+[\d]+)"' />
$sender is empty when using the 15 credit, I think it is looking for a number ?! so the condition fork should not be there
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 12:32:55 pm
Now 15 is working again, and I think 35 will be ok too, but I will wait to check for 35 too
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 12, 2010, 01:12:51 pm
Quote
It had a typo too, I changed it to "smskostnlos"
Sorry for the typo

This part makes it not working, jumps to logout, I deleted it :)

    <fork id="sender_check">
      <condition type="empty" var1="$sender" ko_error="$L_ERROR_GENERIC" />
    </fork>

      <var in="page" name="sender" search="regex" regex='option value="(\+[\d]+)"' />
$sender is empty when using the 15 credit, I think it is looking for a number ?! so the condition fork should not be there
Mmhh... yes I extract the phone number in that regex.
But the following fork:
Code: [Select]
    <fork id="sender_fork">
      <condition type="equal" var1="$credit_mode" var2="hspeed" ok_id="sender_check" ko_id="kostenlos_sender" />
    </fork>
is used to make the execution jump directly to the offending tag you posted in case $credit_mode is "hspeed" that is the value when you want to use your mobile phone number (35 credits), isn't it?
Otherwise (if $credit_mode is NOT "hspeed", that is 15 credits), the following step is executed:
Code: [Select]
    <dummy id="kostenlos_sender">
      <var name="sender" value="smskostnlos" />
    </dummy>
And this step fixes the $sender to be "smskostnlos", and this means that the following test for emptiness of the $sender variable should work anyway.

Its strange that you were brought to logout (this means the error was raised)..are you sure you had selected the 35 credits mode in service config? I can't test it right now as my stupid internet connection fails to open kostenlos website right now.
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 01:15:29 pm
Yes I have checked both, but that part is not working well, I will trace it again tomorrow to find out what is wrong with that section. The web site the same as yours here too unfortunately :(

The logic seems OK but a generic error is comes up, in that fork part which should be checked
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 12, 2010, 01:35:07 pm
I just traced it with another account of my friends with 15 credits


Entering step "kostenlos_sender"
Assignment: $sender = smskostnlos
Entering step "sender_check"
Evaluate condition: Is 'smskostnlos' empty?
Evaluation result => The condition is NOT verified, this means: the following error will be thrown: '$L_ERROR_GENERIC'
Entering step "5"

This is checking for being empty, I mean if it is not empty if will thrown the error!

It is strange!
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 12, 2010, 06:48:35 pm
Oh silly me...I was saying in the xml service "when 'is $sender empty?' is not satisfied (ko_error), that is when $sender is not empty, throw an error..I had inverted the error condition!

The fix can be made in two ways, like this:
Quote
<condition type="empty" var1="$sender" ok_error="$L_ERROR_GENERIC" />
or like that:
Quote
<condition type="not_empty" var1="$sender" ko_error="$L_ERROR_GENERIC" />
I choose the latter.

Please use the attached script, this should hopefully be the final one (if the 35 credits mode also works).
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 13, 2010, 05:21:16 am
Ok I will check it just with 35 credit, because the 15 credit did worked that time , the condition was not satisfied and I removed so the 15 credit works. Now if the 35 credit works as well it will be final. I don't have 35 credits yet, I will gather it for the final check. I hope this is the final one :)
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 13, 2010, 08:31:33 am
I've found that I can send messages with the 35 credit mode even if I couldn't verify the mobile number, but obviously my mobile number is not shown, the website fixes the sender to "smskostnlos"..
So I've changed the service to not require the mobile phone number to be found, and added an alert when it is not found like in my case.

I've also added an informative message on the "ads" service to inform the user if the message can't be sent at all because of the missing mobile phone number confirmation.
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 13, 2010, 09:46:58 am
Yes, but honestly there is no use if some one wants to use the 35 credit without registering the mobile number. The only which is remained is to be checked by number which will be sent by 35 credits.

That informative part on non registered phone is also working great, good adding :)

The other information given on non registered phone account while sending by 35 credit is also working fine ...

Just just just one test is remained .......................
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Mip104 on May 15, 2010, 04:06:36 am
Wow, the 35 credit is working too :) the script is OK now.
Title: Re: Kosetenlos Free and Credit based XML services
Post by: Zydio on May 15, 2010, 12:17:54 pm
Ok, I've uploaded the services on the SVN, updated and improved the two official services threads and removed from them your original (and now old) services.

This thread is now closed, if there will be problems we will discuss them on the official service threads.