Parse-Server query fed directly from URL query string - node.js

I'd like to know if this is even possible. And if it is possible, what the security ramifications would be.
I want to use Javascript to build a dynamic URL to query a Parse-Server database.
It appears that it might be possible based on an earlier Stackoverflow question here and a Node.js doc here
Here's how I envision it working....
So, a user would be sent (via email/Twitter/etc) a link which was created by above method. Once the user clicked on that URL link, the following would happen automatically:
Step #1: User's system would automatically submit a parse-server query.
Step #2: On success, the user's browser would download a web page which displayed the query results.

step one create the pointer value ie the query pseudo-semantic
step 2 insert the pointer value to a text-type field in parse cls=clazz
step 2b mailgun a msg containing a link like :
express.domain.com/#!clazz/:yALNMbHWoy - where 'yA...oy' is oid of pointer row in parse/clazz table
Note that the link is an abstraction only. Its a uri first to express/route && function that will simply get a row from parse.clazz. That row contains the semantic for making a parse query to get back the full DB compliment to pass along to the node template setting up the html ...
in your node/router GET/clazz/:oid will lookup that Parse row in parse/clazz, using the pointer/text value to format a 2nd, Parse query. The query response from the 2nd parse.qry is your real meat ... This response can be used by the express template formatting the html response to orig request on "express.domain.com".
where u ask "download web page" .. that is simply node's RESPONSE to a GET on a route like "GET/clazz".

Related

Issue in reading paginated API data using ADF

I am trying to read the data from a paginated API using ADF copy activity. While accessing the API at first time, only the base URL is used(without any query params). When API returns the data, it will have a key called cursor with some token. This has to be passed as query string to get the next page. How to implement this using ADF?. How to append "?cursor=" in the base URL and then add cursor value from API response
First Page : {{Base URL}} #returns a JSON with a key called cursor
From Second Page : {{Base URL}}?cursor = {{value of cursor key in JSON Response}}
I have tried using Query Parameters inside the Copy Activity of pagination. But it is not working
You can use web activity to the cursor value and pass it to the relative URL in copy activity.
You can first make a call with the base URL using web activity.
Parameterize the relative URL in the dataset.
Connect web activity to copy data activity and pass the web activity output required value to the copy activity dataset parameters to run the URL with cursor value.
Ex: #concat('?cursor=',activity('Web1').output.cursor)

excel web query properties from drop-down online

I am trying to retrieve data from http://www.professorpaddle.com/rivers/riverlist.asp which automatically defaults to Washington state as the state id. However, I want to pull data from the table for Oregon. Can this be done as a property? So far I've tried writing a .iqy file with the following and it still doesn't work:
WEB
1
http://www.professorpaddle.com/rivers/riverlist.asp?hstateid=["oregon"]
Selection=EntirePage
Formatting=All
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
I am new to VBA but open to using it as well.
You've got two issues:
The page you linked uses a POST not a GET request so you have to write the parameters separately, not as part of the URL.
I'm not sure why you're supplying oregon as the hstateid. When examining the request in Chrome's dev tools I see 37 as the value of this parameter.
And the brackets around the value indicate that you want you to specify variable values for the parameter but I think you're trying to just have a static value here.
So your query should start with something like:
WEB
1
http://www.professorpaddle.com/rivers/riverlist.asp
hstateid=37

How to handle dynamic value which is not in source code in NeoLoad

I am using NeoLoad, I am facing an issue that a dynamic value which is not in previous source pages.
I logged in as a User.
I just click on Menu Link, when I click on this menu link, a dynamic value is generating with this link.
In the above the URL the StartPage=1433433137 this is dynamic value, which is not found in any previous source pages, so when I click on link menu this URL generate a new StatPage=13232334, so how to extract this value or how to handle this.
When I verify this variable name StatPage in previous sources pages, I found in a html page as JavaScript variable is defined like var StatPage = true; and also url.open('GET','id=1&StatPage=' + startDate, true);
And another .js file is also having this variable like
if(typeof StatPage!="undefined"&&StatPage) - <some more text here>
Any one help how to handle these type of dynamic values, I am using NeoLoad Performance testing tool.
I don't have a full solution for your situation, but would like to share some thoughts that may give you some direction.
It looks like the 10 digit integer number in the query string after StartPage is a dynamic parameter created on the client as a result of executing a JavaScript function. Based on the variable name startDate it is stored in, I think there is a date-time related function. If I need to guess further, this may be the epoch time convert to seconds (see jquery convert number to date?). You can verify this with developers.
In any case, to parameterize such test case you need an option to parameterize a query string with client-side functions. You can check if NeoLoad supports, such functionality.

Re-using a list in Node.Js

I'm developing a web scraper in Node JS and I'm trying to figure out the best approach to combine data from one list, with data on another list.
For example:
Step 1: Scrape data from website A
In this step, I scrape some data using cheerio/request and store this in a list, which is then displayed on the screen in a jQuery data table. The data table has a checkbox next to each scraped row of data and the value I have assigned to each checkbox is a "URL".
Step 2: Scrape again based on URLs chosen in checkboxes
In step 2, the app will scrape another website based on the URLs selected in step 1 and will retrieve some data values from these URLs that are scraped.
My dilemma
I wish to use some data values that were scraped in step 1 along with some data values scraped in step 2. However currently in my app, the data from Step 1 has been lost because it's not being saved anywhere.
Since this is a sort of dynamic search whereby a user will search for data, scrape it and then not neccessarily want to see it again, I think saving data into a database would be overkill? So I'm wondering if I should save the list data from step 1 into a session variable and then link them up together again using the URL (in the checkbox) as the key?
Thanks for your help!
Anthony
if you dont want to do saving for these data then pass it as another inputs of your form , try
< input type=hidden value=json.stringify(item)/>
I dont think using database for storage of the scrapped conetent would be an overkill.
The ideal points to note in this process would be.
Use a document store like mongoDB to dump your json data directly. I proposed mongoDB because you get more resources to refer.
Initially open up a db connection in node and your scraping deamon can reuse it for each time when it parses the http result using cheerio and dumps it to db.
Here Once you get the output from http request to your Target URL, the cheerio parse steps should take more time than dumping the data to a db.
I have followed a similar approach for scrapping movie data from imdb and you can find the corresponding code in this repo, if you are interested. I have also used cheerio and its a good selection in my opinion.

Passing form data to another form via url in lotus

I am working on a new web app in lotus/domino. I am newer to lotus/domino programming, so forgive me for not knowing something simple.
What I am trying to do is display a table of information, with one of the columns containing a link. The link is formatted like [http://server/app.nsf/form?openform&ideaNum=1&var2=foo2]
How can I retrieve the information from the url, to get information from a view or a document?
So far I have tried to access the query string in the webQueryOpen event, but lotus runs the agent before the DOM writes to the browser, the query_string isn't available.
I am not sure how else to get information from one form to another in lotus.
Thanks for the help.
-Kris
If you're passing multiple params in the query_string, you can get Domino to do a bit more of the work for you. There's an Function command - UrlQueryString - that can format the params into a list, delimiting at the "&".
E.g. server/app.nsf/form?openform&ideaNum=1&var2=foo2
becomes a list:
openform
ideaNum=1
var2=foo2
To use it, on the destination form create a multi-value text field called something like "QryStringList".
Set it to be computed when composed, and set it's value to #UrlQueryString.
In your WebQueryOpen agent, you can access the params as doc.QryStringList(0), docQryStringList(1) and so on, if you're using Lotusscript.
I'm fairly sure I put this together using info from the IBM/ldd forum, but the exact source is lost in the mists of time and memory, so apologies if I've copied someone's post.
Just as a follow up, I found that you are able to specify an on form variable named the same as QUERY_STRING. The variable is actually a reserved term for Lotus, so Lotus pre-fetches the variable before running the information out the browser.
Due to the pre-fetching, you are able to access the url information during the webQueryOpen event.
I hope this helps someone else looking for the same type of functionality.
-Kris

Resources