Conversation
Travis failed the rainfall tests (due to an unrelated change). A commit to fix those failures is at #1589 |
thanks a million @pfirsichbluete |
@tagawa apologies for the long delay! This is looking great. I have a couple suggestions though:
The result looks like this: /cc @abeyang @chrismorast any thoughts? |
Thanks for the suggestion @moollaza. I've made this change:
I also changed the IA display name to "Indeed Jobs" rather than just "Jobs" to avoid duplication with GitHub Jobs (which will also need to be changed). |
@tagawa awesome, thanks for adding those changes!
Actually both should just have "Jobs" as their |
|
||
triggers any => "job", "jobs"; | ||
|
||
spice to => 'http://api.indeed.com/ads/apisearch?publisher={{ENV{DDG_SPICE_INDEED_JOBS_PUBLISHER}}}&v=2&useragent=DuckDuckGo&userip=1.2.3.4&q=$1&l=$2&co=$3&format=json&callback={{callback}}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more small fix, let's change the APIKEY placeholder to our canonical wording: DDG_SPICE_INDEED_APIKEY
Hi again @moollaza. Appreciate the clarification - I've made those changes. |
You're correct, our policy is to prevent duplicate Instant Answers like this scenario so we're going to reduce the trigger space of the GitHub Jobs IA by changing the trigger to "github jobs" |
triggers any => "job", "jobs"; | ||
|
||
spice to => 'http://api.indeed.com/ads/apisearch?publisher={{ENV{DDG_SPICE_INDEED_APIKEY}}}&v=2&useragent=DuckDuckGo&userip=1.2.3.4&q=$1&l=$2&co=$3&format=json&callback={{callback}}'; | ||
spice from => '([^/]+)/(.*?)/([^/]*)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tagawa it's best to put optional checks at the end and only return them if they're defined otherwise you'll end up with a double slash //
which gets automatically changed to /
by NGINX.
spice from => '([^/]+)/([^/]+)/?([^/]+)?';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this doesn't actually apply here -- you're returning ' '
not ''
so it's OK
Hi @tagawa . This IA looks good! There are some things we'll need to modify on our end (the template itself), but as far as yours stand, it's good! 👍 |
if ($1 || $2) { | ||
my $query = $1 || ' '; | ||
my $location = $2 || $spice_location || ' '; | ||
return $query, $location, $country; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we either need to handle the country a little bitter, or ignore it for now. if I try to search for job in a city outside my country, I'm going to get really weird results or none. e.g. "jobs in philadelphia" sets the country to CA
because I'm in Canada, which sends some mixed signals to Indeed.
We should either check for the presence of a country and get the country code using Locale::Country
(a few other Spice do this) or we should try and pass the whole location along to Indeed (I'm not sure how well they handle that?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the Indeed API is only for the US, e.g. for "Paris" it defaults to Paris, Texas and there are no results for Paris, France. I agree we should ignore $country
completely but should we also restrict the IA to searches from the US only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it supports all the countries they have websites for. It definitely had results for Canada when the country was set to CA, and I just tried Brazil and India and they have results there too. I'd like to keep it open to all users because I can imagine lots of people outside the US look for jobs there.
I think the easiest route is to mimic the Time Spice which uses a large list of the biggest cities for most countries. https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Time.pm#L23
That should allow us to get great coverage for the majority of queries. If needed, we can add internal "deep" triggering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still wondering about the best way to handle countries. You're right that they support more than just the US but they can't handle the whole location without country being a separate parameter.
I think most practical would be a hash lookup of capitals/countries, and perhaps a separate check for the country name in the query. This still wouldn't catch your Philadelphia (Canada) example but it would be better than nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most practical would be a hash lookup of capitals/countries, and perhaps a separate check for the country name in the query.
@tagawa I just realized we didn't implement this yet -- that approach sounds good to me!
Just curious @tagawa --
|
|
No, there's no limit. But any missing/empty params will be collapsed (i.e. FYI: We're bringing front-end filtering to the UI very soon, which will allow users to filter the original returned results, and also re-query the API with added filters |
Thanks @moollaza. The value of |
Everything LGTM 👍 |
Rewrite of Indeed Jobs IA. Fixes #1584
Thank you both. Job-related templates sounds good so I'll look out for those. |
Looks great! Thanks for the heads-up @jagtalon. |
What does your Instant Answer do?
Gets 10 jobs posts from indeed.com
What problem does your Instant Answer solve (Why is it better than organic links)?
Shows location, company and how recent the job posting is.
What is the data source for your Instant Answer? (Provide a link if possible)
https://ads.indeed.com/jobroll/xmlfeed
Why did you choose this data source?
Suggested by @moollaza: https://duck.co/ideas/idea/604/jobs-listings-from-indeed-com
Are there any other alternative (better) data sources?
GitHub jobs and other job sites, but I believe indeed.com aggregates a lot of these.
What are some example queries that trigger this Instant Answer?
"web developer jobs"
"jobs in boston"
"tax accountant job in san francisco"
Which communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)
Adults looking for a job
Is this Instant Answer connected to a DuckDuckHack Instant Answer idea?
Yes: https://duck.co/ideas/idea/604/jobs-listings-from-indeed-com
and fixes #1584
Which existing Instant Answers will this one supersede/overlap with?
Probably supersedes github_jobs
Are you having any problems? Do you need our help with anything?
What are the terms of use for the API? Will DuckDuckGo need specific authorization (e.g. an API key)? Are there any costs associated with API usage?
The API is free but an API key (publisher ID) is required, as well as attribution.
Where did you hear about DuckDuckHack? (For first time contributors)
Contributed IAs a couple of years ago.
What does the Instant Answer look like? (Provide a screenshot for new or updated Instant Answers)
Checklist
Please place an 'X' where appropriate.