sottenad / jservice Goto Github PK
View Code? Open in Web Editor NEWA set of simple trivia service that serves the answers/questions pulled from jArchive
Home Page: http://jservice.io
License: MIT License
A set of simple trivia service that serves the answers/questions pulled from jArchive
Home Page: http://jservice.io
License: MIT License
I am wanting to use this to quiz myself, but would like to know where exactly the data is coming from and how frequently the underlying data for the service is updated (every show, every week, etc). Any clarification would be appreciated!
I was trying to find all clues after e.g. 2022.
https://jservice.io/api/clues?min_date=2023-01-01 is what I searched.
I also tried https://jservice.io/api/clues?min_date=2023
I'm seeing results from 1993 and 2000.
Either I am not doing the right date formatting, or something is broken.
Clues with a <br>
tag in the clue_text
aren't captured properly, since it's not part of the text()
.
For example, in Show #6934, the first clue_text
is captured as charmeck.orgis the site for this city & Mecklenburg County
(note the missing space between .org
and is
).
Hello, I'm building a relatively extensive study platform and am going to be building a data scraping API to gather and generate correct and incorrect answers to questions.
I was wondering if you have any thoughts on this and whether or not your service could be modified to provide 1 correct answer per question as well as a few incorrect ones as well (based on the context of the question).
http://jservice.io/ is returning a "We're sorry, but something went wrong." page with a 500 HTTP error status code.
Is there an example payload that's returned from the /api/invalid endpoint? I don't want to mark a clue invalid just to see what the APIs response is. Or if there's a specific clue id that we can mark invalid solely for testing purposes?
Hi,
I am new to rails and postgres, and I am trying to setup jService and stuck at the following error:
$ noglob bundle exec rake get_clues[1,4]
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:76: warning: circular argument reference - reflection
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:80: warning: circular argument reference - reflection
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:84: warning: circular argument reference - reflection
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:103: warning: circular argument reference - reflection
rake aborted!
PG::ConnectionBad: FATAL: database "jarchive_development" does not exist
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `initialize'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `new'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `connect'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:548:in `initialize'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:53:in `connection'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:208:in `columns'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:217:in `columns_hash'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/dynamic_matchers.rb:60:in `block in valid?'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/dynamic_matchers.rb:60:in `each'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/dynamic_matchers.rb:60:in `all?'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/dynamic_matchers.rb:60:in `valid?'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/activerecord-4.0.2/lib/active_record/dynamic_matchers.rb:18:in `method_missing'
/home/ubuntu/jService-master/lib/tasks/get_latest.rake:48:in `block (3 levels) in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.6.5/lib/nokogiri/xml/node_set.rb:237:in `block in each'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.6.5/lib/nokogiri/xml/node_set.rb:236:in `upto'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.6.5/lib/nokogiri/xml/node_set.rb:236:in `each'
/home/ubuntu/jService-master/lib/tasks/get_latest.rake:46:in `block (2 levels) in <top (required)>'
/home/ubuntu/jService-master/lib/tasks/get_latest.rake:28:in `each'
/home/ubuntu/jService-master/lib/tasks/get_latest.rake:28:in `block in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `load'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `kernel_load'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:24:in `run'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/cli.rb:304:in `exec'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/home/ubuntu/.rvm/gems/ruby-2.3.0/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.3.0/bin/bundle:23:in `load'
/home/ubuntu/.rvm/gems/ruby-2.3.0/bin/bundle:23:in `<main>'
/home/ubuntu/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => get_clues
(See full trace by running task with --trace)
Thank you!
I am working on an app that would benefit from a Final Jeopardy endpoint. Is there a way to accomplish this currently? If not, could this be implemented as its own API endpoint (like /final
)?
For others to be able to use this code, there must be a License with this repo.
Since this project is built on rails, it makes sense to me it should have an MIT-License:
https://opensource.org/licenses/MIT
To anyone trying to use jservice right now - we are experiencing a DNS issue with our managed DNS provider. We are working to get more information.
0876b63 changed the /random
endpoint to always return one clue, ignoring the count
parameter.
Would it be possible to enable CORs on the jService API? I'm having trouble accessing the API.
I think something like rack-cors (https://github.com/cyu/rack-cors) would do the trick.
This is currently down, might be the DNS. I was using this for a school project for my students, and it was up not that long ago, but now I can't finish marking. Hopefully this is an easy fix
DEPRECATION WARNING: config.whiny_nils option is deprecated and no longer works. (called from block in <top (required)> at /Users/myuser/Projects/jService/config/environments/test.rb:15)
I received this error when trying to run RAILS_ENV=test rake db:migrate
When you attempt to get_clues, you get an error:
NoMethodError: undefined method `captures' for nil:NilClass
var_answer = answermatch.captures[0].to_s
^^^^^^^^^
This is because the answermatch might be nil. I fixed it by placing that into an if block checking for nil answermatch and skipping if not - and then it works - but it doesn't.
Now it doesn't make ANY clues. It correctly gets categories, but never gets a single clue.
http://jservice.io/ is down.
I haven't imported the whole database (as I'm not totally sure how), but I figured I could just use questions/categories from a certain season, as suggested in the Readme.
I've bundle installed everything successfully, and I'm able to make calls to the (empty) api/clues/ on my local host. However, when I try to populate the database using rake get_clues[30,31]
, I get the following error:
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:76: warning: circular argument reference - reflection
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:80: warning: circular argument reference - reflection
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:84: warning: circular argument reference - reflection
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-4.0.2/lib/active_record/associations/has_many_association.rb:103: warning: circular argument reference - reflection
rake aborted!
NoMethodError: undefined method `sanitize_forbidden_attributes' for #<PgSearch::Document:0x007f840d756fc8>
Did you mean? sanitize_for_mass_assignment
/Users/tuckyeah/wdi/projects/jService/lib/tasks/get_latest.rake:48:in `block (3 levels) in <top (required)>'
/Users/tuckyeah/wdi/projects/jService/lib/tasks/get_latest.rake:46:in `block (2 levels) in <top (required)>'
/Users/tuckyeah/wdi/projects/jService/lib/tasks/get_latest.rake:28:in `each'
/Users/tuckyeah/wdi/projects/jService/lib/tasks/get_latest.rake:28:in `block in <top (required)>'
Tasks: TOP => get_clues
(See full trace by running task with --trace)
It looks like it's an issue with pgsearch, but I'm afraid I'm not really sure where to start... any advice would be greatly appreciated! Thanks!
Currently trying to use https on jservice.io fails because of a certificate error since the cert provided is for *.herokuapp.com
.
None of the responses have Content-type: 'application/json' in the response header. This makes me have to manually decode the response.
https://jservice.io/ is showing a page saying:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail" page
and returning a 503 Service Unavailable HTTP error.
Hi there,
I am total newbie to ruby and i am getting Peer Authentication error for user steveo on server when i request http://localhost:3000/
I think it's configuration error but i am not able to track it down. It would be great if can get any sort of help.
This is how my database.yml looks like:
development:
adapter: postgresql
encoding: unicode
database: jarchive_development
pool: 5
username: steveo
password: stepheno
.# Warning: The database defined as "test" will be erased and
.# re-generated from your development database when you run "rake".
.# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: jarchive_test
pool: 5
username: steveo
password: stepheno
production:
adapter: postgresql
encoding: unicode
database: jarchive_production
pool: 5
username: steveo
password: stepheno
I tried running the string in normal windows terminal and in VS code terminal and neither of them worked, both were cd'd into the correct location, but it still returned the error bundle: the term "bundle" is not recognized as the name of a cmdlet...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.