need help with httprequest and parsing info
Moderators: JRL, Dorian (MJT support)
need help with httprequest and parsing info
what im trying to do is check ip of my computer and compare that info with and ip saved to my web pages logfile and see if they have visited my thank you page and to check current date and see if its been more then say 30 days since thy visited my thank you page so basically if the ip matches check to see if is is thankyou page and if its been more then 30 days and if all 3 of these are correct then the program will run if not then program ends
so if ip matches and page has been visited and its been less then 30 days run program else end
im totally confused please help if i get this figured out i can buy the full version of macroscheduler with compiler
so if ip matches and page has been visited and its been less then 30 days run program else end
im totally confused please help if i get this figured out i can buy the full version of macroscheduler with compiler
Last edited by idiot on Mon Mar 02, 2009 9:53 pm, edited 1 time in total.
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Without going to the links, I think we could comfortably say this can be done with Macro Scheduler.
You will probably get more help if you provide the samples of the logs and files directly in your posting, rather than providing links to other pages.
You will probably get more help if you provide the samples of the logs and files directly in your posting, rather than providing links to other pages.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
heres a copy of log file
deleted
Last edited by idiot on Mon Mar 02, 2009 9:54 pm, edited 1 time in total.
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Still not clear, but you could use RegExpression to save those lines with "GET /thank you" and parse out the IP and the date from those lines:
71.14.155.168 - - [21/Feb/2009:22:13:42 -0800] "GET /thankyou
You can now use MidString to get the IP, and the date.
You can then remove all lines that are over 30 days, for example.
The result is a list of IPs that have visited the thank you page in the last 30 days.
71.14.155.168 - - [21/Feb/2009:22:13:42 -0800] "GET /thankyou
You can now use MidString to get the IP, and the date.
You can then remove all lines that are over 30 days, for example.
The result is a list of IPs that have visited the thank you page in the last 30 days.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
this dosent work but maybe this helps show what i want to do
Code: Select all
///ok here is where i get ip of my computer
Let>HTTP_TIMEOUT=5
HTTPRequest>http://checkip.dyndns.org,,GET,,HTMLResponse
Position>:,HTMLResponse,1,StartPos
Add>StartPos,2
Position><HTMLResponse>Endpos,1
MidStr>HTMLResponse,StartPos,EndPos,YourIP
///and here is where i get information from the website
HTTPRequest>http://customgameauto.com/logs/access.log,,get,info,strHTML,,,,
///and here is where i should parse the data to get ip address
///what im trying to do is compare info with YourIP to see if ip
///on computer matches one in log file
if>info=YourIP
goto>grant
else>
goto>deny
endif
label>grant
Message>access granted
endif
label>deny
Message>access denied
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
So, just use the Position command. Pos returns the position of one string inside another. If it does NOT exist it returns zero. So if it DOES exist you get a value greater than zero. So:
This simply says if YourIP is *anywhere within strHTML* goto Grant.
To reiterate. This simply looks to see if YourIP is SOMEWHERE INSIDE strHTML. It does not care where or how many times. Just whether or not it exists somewhere in the log file.
Code: Select all
///ok here is where i get ip of my computer
Let>HTTP_TIMEOUT=5
HTTPRequest>http://checkip.dyndns.org,,GET,,HTMLResponse
Position>:,HTMLResponse,1,StartPos
Add>StartPos,2
Position><HTMLResponse>Endpos,1
MidStr>HTMLResponse,StartPos,EndPos,YourIP
///and here is where i get information from the website
HTTPRequest>http://customgameauto.com/logs/access.log,,get,info,strHTML,,,,
Pos>YourIP,strHTM,1,p
If>p>0
Goto>grant
Endif
To reiterate. This simply looks to see if YourIP is SOMEWHERE INSIDE strHTML. It does not care where or how many times. Just whether or not it exists somewhere in the log file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That's this line, copied from YOUR post:
Position>Endpos,1
It's wrong. But I don't know what it is meant to be as I copied it from your post. I think it got mangled by the forum (always worth turning off HTML and Smilies). But since it's YOUR code you should already have the original in your script. MY code was only the last 4 lines.
Position>Endpos,1
It's wrong. But I don't know what it is meant to be as I copied it from your post. I think it got mangled by the forum (always worth turning off HTML and Smilies). But since it's YOUR code you should already have the original in your script. MY code was only the last 4 lines.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
ahh ok this works now your right
ok now that i got the basic http down
how do i detect line that ip was found on so i can use that line for other data like /thankyou
ok now that i got the basic http down
how do i detect line that ip was found on so i can use that line for other data like /thankyou
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Ah, so now your requirements change. That is different from just knowing whether the IP is in the file.idiot wrote:ahh ok this works now your right
ok now that i got the basic http down
how do i detect line that ip was found on so i can use that line for other data like /thankyou
Here's a way to see what line it's on:
Code: Select all
//Loop through all lines:
Separate>strHTML,CRLF,lines
Let>k=0
Repeat>k
Let>k=k+1
Let>this_line=lines_%k%
//see if YourIP is in this_line
Pos>YourIP,this_line,1,pline
If>pline>0
MessageModal>%YourIP% found on Line: %k%
Endif
Until>k=lines_count
I expect you'll come back with more detailed requirements next ;-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
more detailed requirements 8-P
ok so now i can get line number how do i use httprequest to search specific line?like once ive got the line that has the ip address then search that line for more data and if failed go to next next line search for ip again etc
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
bump
Last edited by idiot on Mon Mar 02, 2009 9:14 pm, edited 1 time in total.
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!