The Daily Click ::. Forums ::. Klik Coding Help ::. Find and select date
 

Post Reply  Post Oekaki 
 

Posted By Message

Avantar1975



Registered
  01/12/2011
Points
  39
6th December, 2011 at 17:24:35 -

OK...I have a Rich Text Object that gets different text pasted into it: One such variable is a date. Is there a way to select the date each time? The date format will be something like 2012-11-30. The date appears in a web page source - To be more specific, it is expiary dates that will show like this:<div class="form-label field-label wide-20"><span>Expires:</span></div>
<div class="form-field wide-80">2012-11-30</div>

Any help will be appreciated.

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
6th December, 2011 at 20:10:50 -

It just so happens i have had to do something similar for an application i have created!

Does the date always Appear in that format? If so it is actually quite easy to do but i need some more info from your webpage source code first before i can give you the exact code you need. I will try to explain it as best as i can though through an example:

<div class="form-label field-label wide-20"><span>Expires:</span></div><div class="form-field wide-80">2012-11-30</div><extra html tags and rubbish......>


Start of Frame
--Load file "webpage" into Rich Edit Object

Find "Expires:</span></div><div class="+""""+"form-field wide-80"+""""+">" - The """" makes MMF include a " in the expression editor (it is 4x")
Set Alterable Value A of Rich Edit Object to Caret Position + Number of characters in the chosen string (in this example it is 53)
Find "</div><extra html tags and rubbish......>"

Set Edit Object (or whatever you are displaying the date in) to Get Text RichEditObject("RichEditObject",Alterable Value A,Caret Position)

This will then pull out the text between those two sections.

This is not the most efficient way of doing it but it works and someone here may have a better method. If you need me to create an mfa example let me know.

Hope it helps


Edited by lembi2001

 
n/a

Avantar1975



Registered
  01/12/2011
Points
  39
6th December, 2011 at 22:44:51 -

That sound absolutely on the money. I will try it soon. I hope it is always in that format! It is the source from domaintools.com for checking when a domain expires. I have created an app to run through all my co.za domains - very easy - to check which are paid, not registered anymore and so forth. Hopefully I can do something similar for the other domains and thought that having the expired date should be ok for me.

I will still have to figure out an export method of the results though.

Can't wait.

Ps. I always apreciate an example!

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
6th December, 2011 at 22:54:04 -

How are you getting the web page source file?

I used wget (http://www.gnu.org/software/wget/) as it allows access to the site using proxy credentials if required. It also allows you to pass the url of the site directly into the app and it will allow you to download the source to a specific location.

if you give me a couple of example URL's i will gladly generate an example using wget so you can see how powerful it is

 
n/a

Avantar1975



Registered
  01/12/2011
Points
  39
7th December, 2011 at 17:01:06 -

wget sounds like Linux? (something I know 0-1 about) (How do you use it with MMF?)

I use the object "Get Object" - it will retrieve the source page from where I paste it in the Richtext object.
For examples of webpages: http://whois.domaintools.com/"any domain" - just put your domain name after the slash without the quotes.

I am from South Africa and therefore our domains are mainly co.za - what makes this easy is that all is in plain text and text like:"Not Paid", "Suspended" and "No Matches" will show in the source. (Makes it easy just to select the text)

My app works like this: I have an edit box and an add and delete button. A fast loop will write the contents of the edit box to an ini file and another fast loop will read this to a IconList Object(Similar to combobox, but you can have images added per line). Then I've got a check button and a delay(So I do not get bugged out for too many requests) that runs through all the domains and mark them with the neccesary icon for certain text found in the Richtext object.

For the .com .net and so forth I will rather settle for the expiary date to which you for sure have the sollution - this opens up more possibiliries for me

My code is a bit messy, but I can upload an example to some place if you want - not sure where, but maybe u can recommend a site.

Thx again.

 
n/a

nivram



Registered
  20/07/2006
Points
  171
7th December, 2011 at 21:25:59 -

box.net

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
7th December, 2011 at 22:16:08 -

if you could upload your source file I could take a look at implementing wget. It's more powerful than the get object.

You could upload to the mfa repository http://mfa.aquadasoft.com/

 
n/a

Avantar1975



Registered
  01/12/2011
Points
  39
8th December, 2011 at 04:13:32 -

I tried to upload it, but all I get is this: Could not upload file - please try again.
My file is only 60K big.

So I uploaded one of my early version here as an example: http://www.2shared.com/fadmin/24575420/c3cf7b95/Domain_Checker.mfa.html




 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
8th December, 2011 at 09:38:43 -

Ok, got it, let me take a look and i'll see what i can do for you.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click