Take jobs from jobvite with javascript - javascript

Is there any way to take the list of available positions for a company from JobVite using javascript (I would prefer if it returned JSON)?
I would like to take 5 random open position and display them in a recruiting region on the website I am working on.

I can confirm that Jobvite DOES have an API, and it returns results in JSON! You need to submit a request to obtain an API key. (Look in the Category dropdown menu)
http://recruiting.jobvite.com/support/customer

Yes. You'll need an API key and secret as blastronaut points out. Then hit this URL:
https://api.jobvite.com/v1/jobFeed?api=KEY&sc=SECRET&companyId=COMPANYID
The API documentation is here: Jobvite Services API PDF

Well, if they have no API, I guess you're going to need to use cURL or something similar and then your PHP could return JSON encoded results?
Failing that, you might check out:
https://github.com/dylang/jobvite

Related

How do I limit the result attributes coming back from algolia?

When I use algolia's instantsearch, the url that I hit returns all the attributes for the object that is hit. I have multiple different types of users and I don't want to just display something like a user's email to the entire world. Is there a way to query algolia differently so that I can limit the returned resultset before it comes to the page?
My current idea is to funnel everything through the our backend but I don't like the idea of limiting the spead of my search results by my own server response speed.
Here's an example of the algolia hit that returns all of my keys:
https://identifier-dsn.algolia.net/1/indexes/localhost_users/query?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%203.18.0&x-algolia-application-id=identifier&x-algolia-api-key=secret_letters
For better control over what kind of data is returned, you can configure the attributesToRetrieve and attributesToHighlight of your index. Take a look at the documentation for the attributesToRetrieve here.
Edit: Also, use unretrievableAttributes if you want don't want someone with a Search API key to get access to some attributes

Screen-scrape paginated data

I'm trying to grab a list of all of the available stores returned from the search at this website.
https://www.metropcs.com/find-store.html.html
The issue is that it returns back only 4 or 5 at a time, and does not have the option for 'See All'. I attempted to use Post Man in Chrome and AutoPager in Firefox to see if I could somehow see all of the data in the background but I wasn't able to. I also was researching JSON interception tools, as I believe the site is using JSON in the return set, but I wasn't able to find any of the actual data that I needed.
In the past I was able to hit 'print preview' and grab the list that way (then I just copy-pasted to Excel and ran some custom macros to strip the data I need) but the printer-friendly version is gone now as well.
Any ideas on tools that would allow me to export all of the stores found, especially for larger return sets?
You want to manipulate this request:
https://www.metropcs.com/apps/mpcs/servlet/genericservlet
You'll notice the page sends this (among other things) as the request to that URL:
inputReqParam=
{"serviceProviderName":"Hbase","expectedParams":
{"Corporate Stores":...Truncated for clarity...},
"requestParams":
{"do":"json",
"minLatitude":"39.89234063913044",
"minLongitude":"-74.85258152641507",
"maxLongitude":"-74.96578907358492",
"maxLatitude":"39.979297160869564"
},
"serviceName":"metroPCSStoreLocator"}
You'll need to manipulate the lat and long bounding box to encompass the area you want. (The entire US is something like [-124.848974, 24.396308] to [-66.885444, 49.384358] )
In your favorite browser it should be easy enough to tweak the request to get a JSON response with what you require.

How do I download 100 images using Google Custom Search API for use with Processing?

A friend and I are trying to create a Photomosaic generator in Processing. We want to be able to pull 100 images from Google using the Custom Search API, restricting the image size and dominant color, along with few other things. We want to save these images so that we can process them in our program. We also want to use data that will come from the GUI to be used to build the API call, i.e the search keyword.
The following code snippet shows what parameters we want to constrain our image search with:
var searcher = new google.search.customSearchControl.getImageSearcher();
searcher.setRestriction(
google.search.Search.RESTRICT_SAFESEARCH,
google.search.Search.SAFESEARCH_STRICT
);
searcher.setRestriction(
google.search.customSearchControl.getImageSearcher.RESTRICT_IMAGESIZE,
google.search.customSearchControl.getImageSearcher.IMAGESIZE_MEDUIM
);
searcher.setRestriction(
google.search.customSearchControl.getImageSearcher.RESTRICT_COLORFILTER,
google.search.customSearchControl.getImageSearcher.COLOR_RED
);
searcher.execute(keyword);
We just aren't sure how to restrict the number of search results or what format the data returns in. Is it JSON?
This is if you are building a URL, and not doing it programatically.
To specify JSON as the return value, append &alt=json to the end of your request URL.
To limit the number of searches returned, use num=50 as one of the parameters
Source: https://developers.google.com/custom-search/v1/using_rest#query-params
The following page has all the documentation for the Google custom search API:
https://developers.google.com/custom-search/v1/overview
At a first glance I can see it's a JSON / atom api. So I guess probably the default return format is JSON and through content negotation you can also request atom (but again, please read the documentation to be sure).

How to load DIV from external website?

I'm trying to load the ratings, used in this Google website, in my own page.
http://www.google.com/maps/place?source=uds&q=restaurants&cid=10470472694367837337
I'd like to show the ratings on my own website, so just loading the ratings-DIV would do the trick.
Any ideas?
You could use PHP (or another backend language) to crawl that page, extracting the div, then pass it to the website.
However, seeing how the ratings come from google, I'd suggest you take a look if there isn't some google API you can use to get the ratings. I don't know what API you can use from mind but this should help you out with that.
http://code.google.com/intl/nl-NL/more/table/
Get the page and parse it.
For PHP you could use http://www.phpclasses.org/package/3086-PHP-Parse-and-extract-information-from-HTML-using-SQL.html to parse it in a SQL style.
You shouls use the places api google provide. Its a webservice that returns information on places and locations. You will need a google account and to setup a api key which you can do here
You can then call this api from client or server side code. The place details results of the place Details api call returns a rating.
You should not just extract html content from another sites webpage!
You can use PHP Simple HTML DOM Parser http://simplehtmldom.sourceforge.net/
$html = file_get_html('http://www.google.com/maps/place?source=uds&q=restaurants&cid=10470472694367837337');
foreach ($html -> find('div.rsw-stars') as $element)
print count($element -> find('.rsw-starred')) . '<br>';

Using Google Analytics without sending query string data

We're doing a simple implementation of Google Analytics on our ASP.NET with jQuery/AJAX web, and for most of it we just call _trackPageview and let Google do the rest.
We do a lot of data transfer in query strings, and recently, management became concerned that a lot of our data (such as product numbers) would be sent to Google. Without discussing whether that should be a concern:
Is it possible to use Google Analytics at all without sending the query string to Google's servers? I know how to filter it out from the actual reports, but I'm looking for a way to prevent it from being sent over the wire at all.
Yes, as Litso said, you can send a whatever you want as the pathname for a GA page-view, but you'll want to automate the process with JavaScript.
The following code will take the current URL's pathname (which excludes the query string) and uses it as the pagename value.
_gaq.push(['_trackPageview', location.pathname ]);
Or, conversely, if you're using the old _gat code,
pageTracker._trackPageview(location.pathname);
So, if your URL is http://example.com/path/to/page.html?supersecretinfo, it will get tracked in GA as /path/to/page.html
In stead of automatically tracking the pageview, you can use
pageTracker._trackPageview('/dir/example.html');
You'll have to dynamically strip out the parameters off of the url of each page. I'm not sure how to do that but it's definitely possible with JavaScript.

Categories