Using YQL and Jquery to check URL validity - asp.net

The answer in this post Use jQuery to check if a URL on another domain is 404 or not? shows how to use YQL in Jquery to check if URL is valid or not. However, I can't get this to work for me. The only difference I can think of is that my URL is a text file (http://mycrossdomain.com/sometext.txt) and not HTML.I think the YQL query needs to be adjusted accordingly. Any help is appreciated.

You can create a very simply data table to bring back precisely what you need with your own custom YQL queries. For example, here is a table for retrieving the headers and status for an URL.
An example table could look like: http://github.com/salathe/yql-tables/blob/master/url/status.xml
You would use it like:
use "http://github.com/salathe/yql-tables/raw/master/url/status.xml" as url.status;
select url, status from url.status where url="http://developer.yahoo.com/";
Ideally, a HTTP HEAD request would be used but AFAIK there is no way for YQL execute to do that at this time.

Related

Purpose of tilde delimited values in URL fragment instead of GET params

I came across an unusual URL structure on a site. It looked like this:
https://www.agilealliance.org/glossary/xp/#q=~(infinite~false~filters~(postType~(~'post~'aa_book~'aa_event_session~'aa_experience_report)~tags~(~'xp))~searchTerm~'~sort~false~sortDirection~'asc~page~1)
It seems the category, pagination and sort options of a widget on the page injects and reads through these values. Does this format for storing data in the URL have a name, or is this an esoteric format someone made?
What's the purpose of doing this over using regular GET params, or at least using a more conventional format after the fragment?
If you inspect the URL carefully, you'll see that the parameters you describe are placed after the fragment (#), meaning they're not sent to the server but used by the client instead.
In this case, the client (JavaScript) builds them into something like an ElasticSearch query that's then POSTed to the server, in order to update listing you see on your screen.

Paw app query request

Hi I am attempting to initiate a query to my backend on Kinvey which is backed by a MongoDB. They require passing URL parameters as such:
?query={"firstName":"James"}
I have tried every imaginable way of setting up these parameters in PAW but either get a success response with no filtering of the data or an error message of URL not supported when I try using a Raw Query String.
I have ran the query using their (Kinvey) backend API interface and it works fine in filtering the results so the problem definitely lies within PAW. I am currently using version 3.0.9. Any suggestions or is this just a bug that needs to be fixed?
Thanks!
I've just tried this setup in Paw and I have a few recommendations:
Paw will URL-encode the chars { and " as you can see if you open the HTTP preview in the bottom panel
Trying to send a similar query via Chrome (to test with another app to make sure Paw behaves correctly), I see that the query is URL encoded (try this query https://echo.paw.cloud/?query={"firstName":"James"} you'll see that the browser actually URL-encodes the characters { and " when sending. So the behavior is the same with Paw.
I don't think these two chars ({ and ") are valid HTTP if they are not URL-encoded, so I'm sure your server is expecting them encoded anyway
Testing this exact query in Paw, works for me, so please try these exact steps: go to URL Params, in the first column enter query and {"firstName":"James"} in the second column. Then using the HTTP preview mentioned above, make sure Paw is sending the request you're expecting.
Lastly, it's more like a tip, but as your value is JSON, I recommend that you use the JSON dynamic value to generate the JSON. It will be visually better for you, and will make sure you send valid JSON. For that, right click on the value field, and select Values > JSON. Here's some example:

how to get query parameter in lua or nginx?

I am trying to implement this-
https://gist.github.com/MendelGusmao/2356310
Lua,nginx based URL shortener,The only change i want to implement is when some query string parameter comes with shortened URL i need to take that parameter and insert into the long URL.
e.g.
http://google.com?test=2 will be like http://abc.in/abc
while hitting on http://abc.in/abc?test=3 I get redirected to - http://google.com?test=3.
For that i need to take query string parameters from $request_URI, can any one help with some code?
You should be able to use ngx.var.arg_name where name is the name of the query parameter you want to access. See Variables with Infinite Names section in this tutorial for details on query parameter handling; you may also check my blog post for Lua nginx/openresty examples.
As an alternative, you can use ngx.req.get_uri_args() to retrieve all query parameters as one table. See this section in the same tutorial for the brief comparison between these methods.
You can also use ngx.var.QUERY_STRING to access the query string and unescape and parse it.
You can obtain the query parameter with just nginx by using $arg_test, test is the name of the query parameter in this example.
This is documented in http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_.

Read and modify POST fields "on-the-fly" using Fiddler

I need to use Fiddler to modify the POST fields sent by a browser. I know I can do that using the Fiddler UI but I want to create a script to do it automatically.
I need to insert the code inside the OnBeforeRequest method and I know I can use regular expressions to parse the POST fields but maybe there is something already available to do it like some sort of object POST with all the current fields, e.g: POST["field1"], POST["field2"], etc.
So...is it possible or do I have to do it manually?
Thanks!
Fiddler itself does not contain a script-accessible POST body parser, which means you'd either need to import one, write one, or use string processing to accomplish this task.

Is it possible to use a search string url with Google Calendar

Would any body know if it is possible to search calendar events with a url string?
For example with gMail you could use:
https://mail.google.com/mail/?shva=1#search/Search+Term
to search for the words 'search' and 'term'
Any help or advice greatly appreciated.
Cheers
Noel
This is how you can search Google Calendar using a query parameter in the url:
https://www.google.com/calendar/render?q=TERM
where TERM is the string you're searching for.
So, you can search using a GET request.
Using Chrome's dev tools, it appears as though Google Calendar searches are performed using a POST request, so you won't be able to pass search terms into urls to fetch a response (which would be a GET request).
Update: Looks like a GET request will still return results, but the response is some form of JSON.
Here is the url (I x'd out my specific info), looks like its not meant for what you want to use it for:
https://www.google.com/calendar/search?ctz=America/New_York&hl=en&as_tp=basic&as_myuids=xxx&as_otheruids=xxx&as_q=kai%20mallea&as_cal=xxx;xxx&secid=xxx
A generalization of the current answer is:
https://calendar.google.com/calendar/b/0/render?q=TERM
where 0 is the index of the desired Google account (if you have multiple accounts).

Resources