Closed Benjamin-Loison closed 11 months ago
Concerning https://codeberg.org/Benjamin_Loison/Food would like to have barcode scanning interactivity (to provide the expiration date) and local filesystem interaction (loading and saving the database is not user-friendly but would still be an improvement I guess).
With a PHP local website we can take arbitrary actions on local filesystem.
Feature description
https://github.com/vaites/termux-scripts/issues/3 I was about to answer:
but I realized that we could proceed to the web-scraping and parsing on a proxy (as unable to retrieve the wanted webpage with XHR due to CORS), that way it even reduce the phone workload. However, the mentioned library seems to be the most starred one I found for the web-browser but I get only very rarely results, even if it draws a green rectangle around the barcode: https://serratus.github.io/quaggaJS/examples/live_w_locator.html. Could try with multiple barcodes, assuming it does not notify again about an identical barcode. Well it works not that badly in fact. Note that Barcode Detection API is not compatible with Firefox...
OpenFoodFacts is a workaround when do not need interactivity but for Petit Navire I need interactiveness. I could try make a dedicated Android app. Firstly making sure being able to run Android Studio in an open-source manner (it requires about 32 GB for the download), then exploring Android Studio would be a good start. View what we are currently video streaming. https://github.com/Benjamin-Loison/android_packages_apps_Aperture/issues/3
Maybe can workaround Marine Traffic vessel id search by name security, by enumerating vessels, as these webpages do not some protected.
https://www.marinetraffic.com
This vessel has an id greater than the limit, but maybe they do not monitor anymore all vessels, but as the id are not that great, let us proceed.
Note that do not find
BELLE RIVE
. But it can help give us an idea of many vessels are tracked, by considering the highest vessel id. Have some ids being base64 (double decoding leads to a great number). Highest ids among the 2757 numeric ones is 995628. Note that forcing an IP that worked does not help. As we face random responses, could give a try to selenium but let us for the moment try many times until a request success, that way we will see if some entries are really unavailable. It seems that there are holes for instance 16 is not accessible after more than 100 requests. While it is accessible: https://www.marinetraffic.com/en/ais/details/ships/shipid:16https://en.wikipedia.org/wiki/Maritime_Mobile_Service_Identity
Unclear if we can get a ship by its name and especially its country with AISStream: https://github.com/aisstream/example/tree/main/python https://github.com/aisstream/ais-message-models/blob/master/python/aisStream/docs/ShipStaticData.md https://github.com/aisstream/ais-message-models/blob/master/python/aisStream/aisStream/model/ship_static_data.py https://opendata.stackexchange.com/a/20812
torsocks
does not help as it requires JavaScript.Could continue investigating
opensource marinetraffic
search engine results.Selenium seems to work quite well, at least not under heavy usage, PHP selenium would be nice.
Additional information
Not read.