
dbeard

I have created a file by downloading data from the web.
this is the line of code
FileWrite($DataFile,HTTPGet($url1))
Where $DataFile is the file location on my harddrive and url1 is the where the data is on the web.
The data gets successfully wrote to the hard drive.
Now my next line of code is $line = FileReadLine($DataFile).
The first line of the Data file is: <!DOCTYPE html>
This fails with the error Input string was not in a correct format.
Now this used to work but with ARC this fails.
What format should the Datafile be in for this to continue?
I am using
var linein = File.readLine(dataFile);
var n = dow.search(linein); (this is line 20 the error is referencing.)
but receive the following error:
Execution Error Line 20 Col 2 - Line 1: Invalid regular expression
another bit of help?
the above code downloads Synthiam's front page questions and parses que questions links using a indexOf.Code:
The method search uses regular expressions.
help with JS:
https://www.w3schools.com/jsref/jsref_indexof.asp
@DJ:
I believe there are some bugs with File class exported to Jint.
*** code edited ***
Red is the "begin text" and Blue is the end
https://www.w3schools.com/jsref/jsref_substring.asp
Definition and Usage
The substring() method extracts the characters from a string, between two specified indices, and returns the new sub string.
This method extracts the characters in a string between "start" and "end", not including "end" itself.
I'll post simple code to demo the issue.
Code:
first time (file does not exist)
Close ARC, Open ARC run the script:
Q: without a close and explicit open how you control reads and writes ?
Locks the file, and you need to close ARC.Code:
In your answer in #16. I think I follow but what I cant figure out is why doesn't your code download all the questions. Why does it stop after 9.
I don't see anything in your code that says just show the first 9 questions.
Look to twitter when you scroll down to the last visible post, the page requests more content from the server same thing here.
synthiam page captures the document page scroll:
and calls the function addSearchContentCode:
the function executes an ajax call to the server /api/search/byType and the server returns more html content (i.e. questions) that content will be appended to a specific document placeholder:Code:
Code:
short story when you request the questions page a fixed number of questions are returned, after each scroll more questions are retrieved from the server.
you can read more about "infinite scroll":
http://harshw.com/infinite-scroll-using-jquery-asp-net-mvc-mustache-entity-framework-paginate/
But I do understand this (I think) the code only reads a page at a time. It will take me some time to digest the above.
one last question for the day. BTW. I have it working now and getting the data from the page thanks to your help.
Here is the question. this is what the data looks like: >5:26 PM</td> The data I want is the 5:26 PM. But depending on the time of day it could be 10:26 PM. Is there a one-liner function that can pull the 5:26 PM or 10:26 PM out from between those markups really easy without including the other stuff?
Code:
I've added two new methods for getting the current read position and getting the file length. It'll be in today's release.
This commands locks the file and does not release the file. Is that an expected behavior ?Code:
Example to capture the red part
The forum break's the JavaScript code, posted code picture:
@DJ
Please read my previous post!
Code: