Code Monkey home page Code Monkey logo

bsf-study-questions's People

Contributors

patricksmorris avatar rsparkyc avatar

Watchers

 avatar  avatar

bsf-study-questions's Issues

typeahead should fix spelling

Right now, if typeahead actually fixes a spelling mistake (it happens more often than I'd like to admit), the logic to overlay the text fails because letters don't quite line up. I'd like to find a way to adjust what I wrote to inject the "fixed" spelling so that everything lines up.

Not all accounts are able to log in

Example:

curl 'https://fff4in4hx53xkqbay4dxybzfze0lvjnm.lambda-url.us-east-1.on.aws/' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Origin: https://bsfapp.ryancaskey.com' \
  -H 'Referer: https://bsfapp.ryancaskey.com/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --data-raw $'{"url":"https://login.mybsf.org/bsfmcaiamprod.onmicrosoft.com/B2C_1A_SignUpOrSignin/SelfAsserted?tx=StateProperties=eyJpZCI6ImQzYjBlZjMzLWRjNTYtNDgwZi1hZGJkLTNhN2IxZTZhMDUwNCIsIm1ldGEiOnsiaW50ZXJhY3Rpb25UeXBlIjoicmVkaXJlY3QifX0=&p=B2C_1A_SignUpOrSignin","method":"POST","headers":{"x-c-data":"[\\"x-ms-cpim-csrf=QWRwbzFBSDEwcnRrSnI1NWl5cEQ1REVCWXdiL3ZnclhGS1E4OVFKTTRZeHByK2UvTmVUQUVtZ2pZT2NCZW5ZdGVYYStReGl3cHdBM05TNVU1WDZKY2c9PTsyMDIzL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B42fbfBcuoFSVyafDTwVttV+HXqF/6D+K15onKCa9WZGG/1DZ+fA==\\",\\"x-ms-cpim-trans=eyJUX0RJQyI6W3siSSI6IjM3ZjBhZWY0LWIzNWUtNDE4Mi05OWFjLTQzYTFmMjBkYmVkMCIsIlQiOiJic2ZtY2FpYW1wcm9kLm9ubWljcm9zb2Z0LmNvbSIsIlAiOiJiMmNfMWFfc2lnbnVwb3JzaWduaW4iLCJDIjoiMGMwYTAyNjQtZTIzMy00N2FiLWE5YWEtM2NlNWVhOTZlMDRkIiwiUyI6MSwiTSI6e30sIkQiOjAsIkUiOiIifV0sIkNfSUQiOiIzN2YwYWVmNC1iMzVlLTQxODItOTlhYy00M2ExZjIwZGJlZDAifQ==\\"]","x-csrf-token":"QWRwbzFBSDEwcnRrSnI1NWl5cEQ1REVCWXdiL3ZnclhGS1E4OVFKTTRZeHByK2UvTmVUQUVtZ2pZT2NCZW5ZdGVYYStReGl3cHdBM05TNVU1WDZKY2c9PTsyMDIzLTEwLTExVDEzOjMwOjE5LjYzNzU3OTNaO3VnVXBRUGpCMHdsaDl2RzRRUTRWUkE9PTt7Ik9yY2hlc3RyYXRpb25TdGVwIjoxfQ==","content-type":"application/x-www-form-urlencoded; charset=UTF-8"},"data":"request_type=RESPONSE&[email protected]&password=REDACTED"}' \
  --compressed

Returns the following error:

{"status":"400","errorCode":"UserAccountNotFound","message":"Login failed for your email/password combination"}

However, I'm able to login to the app with this account.

Passage Discovery Support

If the last question starts with "Passage Discovery", we can actually enable saving for that and do our homiletics right in the app.

Better offline detection and usage.

Now that we've addressed #13, we have a spot where we could enable an offline toggle (though it only tries for token refresh, we'd prob want to try catching any network error). I at least wanted to capture that bit of work before I closed the other ticket (since we did address the "bug" part of the other one)

better prompt generation

For OpenAI integration, we should split up the verses, the question, what's written, and the current sentence into separate parts of the conversation.

rich text support

Github uses a nice rich textbox, perhaps we can use something similar to allow richer text input.

Video Lecture support

Breaking this out from #11

Basically, it looks like it's going to take a lot of reverse engineering. Check out the javascript here:
https://www.mybsf.org/692.002a39b17d60f0e6.js

That seems to be doing the heavy lifting of embedding the Kaltura video player, as well as handling a bunch of the buttons you'd click. For now, either just use the app (or website) to watch the video, or come to class!

Additionally, there seems to be some logic to track who's watching the lecture online, but I don't remember what call that was (or maybe I was misinterpreting what it did).

I can get the notes for the lecture, but I don't know how useful that is yet.

Some additional notes if we do support this.

Looks like we're doing this curl:

curl 'https://bsf-mca-lesson-api-prod.apibsfinternational.org/service/v1/smh/ks' \
  -H 'authority: bsf-mca-lesson-api-prod.apibsfinternational.org' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'authorization: Bearer TOKEN' \
  -H 'origin: https://www.mybsf.org' \
  -H 'referer: https://www.mybsf.org/' \
  -H 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'session-context: MaybeNeeded?' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \
  --compressed

This is actually getting a Base64 encoded string containing a lot of details we need:

0f8f90f725813bcfb047c1cf7185b9f0de050e39|13373;13373;1699463546;0;1699377146.5851;;;;

I see we make this request later:

curl 'https://hwapps.streamingmediahosting.com/apps/ac/index.php?pid=13373&action=has_ac_rules&eid=0_k69xs8kq' \
  -H 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \
  -H 'Accept: application/json, text/javascript, */*; q=0.01' \
  -H 'Referer: https://www.mybsf.org/' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --compressed

That pid seems to come from that string that's returned by the previous call, and the eid comes from the fileLocationUrl in BSF's materials endpoint for the material with materialFileTypeId == 4.

This call also seems pretty relevant:

curl 'https://mediaplatform.streamingmediahosting.com/api_v3/service/flavorasset/action/list?filter%5BentryIdIn%5D=0_k69xs8kq&format=1&ks=ZDQzYjYxOTU2MDFkNWVjYWQ5OTdiNWNkMzllZjI5MmI0ZDU3ZGQxZHwxMzM3MzsxMzM3MzsxNjk5NDYzNTQ1OzA7MTY5OTM3NzE0NS45MTg2Ozs7Ow==' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Origin: https://www.mybsf.org' \
  -H 'Referer: https://www.mybsf.org/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --data-raw '{"headers":{"no-spinner":"1"}}' \
  --compressed

The ks param is what we get back from BSF's ks endpoint as well here

app logging out excessively

We are logging out on any exception, we should only log out if we actually get a response back from the server that says we should (if we don't get a response, we can assume we're not connected to the internet and ignore it for now, but we should probably disable fields, or offer some sort of "work offline" mode)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.