Files
scrapeje/README.md

119 lines
5.0 KiB
Markdown
Raw Normal View History

2022-09-27 18:59:50 +02:00
# CENANDOODLE
2022-09-30 22:22:51 +02:00
Ordinare cibo con doodle in rete locale o anche no
2022-09-27 18:59:50 +02:00
2022-09-30 22:23:18 +02:00
2022-09-27 18:59:50 +02:00
Doodle condiviso su rete locale per ordinare e organizzare cibo e bevande (se previste)
----------------------------------------
# JAWANNDENN
2022-10-01 03:38:46 +02:00
Git software da utilizzare
2022-09-27 18:59:50 +02:00
https://github.com/hartwork/jawanndenn
Si installa
pip3 install jawanndenn --user
o con git clone
git clone https://github.com/hartwork/jawanndenn
./setup.py install --user
si lancia
jawanndenn
2022-09-30 22:24:21 +02:00
La tua macchina quindi hosta il doodle all indirizzo 127.0.0.1:8080 e si avvia una copia di questa demo qui https://jawanndenn.de/
2022-09-27 18:59:50 +02:00
----------------------------------------
jawanndenn --help:
--debug Enable debug mode (default: disabled)
--host HOST Hostname or IP address to listen at (dfault 127.0.0.1)
--port PORT Port to listen at (default: 8080)
--url-prefix PATH Path to prepend to URLs (default: "")
--database-sqlite3 FILE File to write the database to (default: ~/jawanndenn.sqlite3)
--django-secret-key-file FILE File to use for Django secret key data (default: ~/jawanndenn.secret_key)
limit configuration:
--max-polls COUNT Maximum number of polls total (default: 1000)
--max-votes-per-poll COUNT Maximum number of votes per poll (default: 40)
data import/export arguments:
--dumpdata Dump a JSON export of the database to standard output, then quit.
--loaddata FILE.json Load a JSON export of the database from FILE.json, then quit.
2022-10-04 15:48:53 +02:00
-----------------------------------------
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
# DA FARE
# [AVVIARE JAWANNDENN CON jwndn.json PRECARICATO]
"jawandenn --loaddata file.json" promette di caricare un json precaricato nel doodle ma invece da warnings e errori simi a questi:
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
WARNINGS:
jawanndenn.Ballot: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
Operations to perform:
Apply all migrations: admin, auth, contenttypes, jawanndenn, sessions
Running migrations:
No migrations to apply.
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
Importing JSON dump -- this may take a few seconds...
System check identified some issues:
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
WARNINGS:
jawanndenn.Ballot: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
File "/home/sco/.local/lib/python3.9/site-packages/django/core/serializers/json.py", line 70, in Deserializer
yield from PythonDeserializer(objects, **options)
File "/home/sco/.local/lib/python3.9/site-packages/django/core/serializers/python.py", line 103, in Deserializer
Model = _get_model(d["model"])
TypeError: string indices must be integers
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
.local/lib/python3.9/site-packages/django/core/serializers/json.py", line 74, in Deserializer
raise DeserializationError() from exc
django.core.serializers.base.DeserializationError: Problem installing fixture '/home/sco/Cenandoodle/jwndn.json':
"Fatayer con Spinaci"
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
]
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
}
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
# [AGGIUNGERE PIU PEZZI DELLO STESSO PRODOTTO PER SINGOLO UTENTE]
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
scritto dentro a /home/$USER/jawanndenn/jawanndenn/static/js/pool.js c'è:
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
var VOTED_YES_CLASS = 'votedYes';
var VOTED_NO_CLASS = 'votedNo';
var YET_TO_VOTE_CLASS = 'yetToVote';
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
stavo cercando di capire come aggiungere un doppio, triplo, quadruplo... voto. In modo da "votare" ovver acquistare/aggiungere ad esempio DUE fatayer al formaggio per singolo user
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
# [AGGIUNGERE PREZZI DEL PRODOTTO ]
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
Credo si faccia sempre con /home/$USER/jawanndenn/jawanndenn/static/js/pool.js.
Una possibilità potrebbe essere quella di implementare aggiungendo le liste(prezzo, desc, npezzi) nel javascript facendole comparire tramite un mouseHover. Oppure il prezzo lo si potrebbe aggiungere accanto al nome (e quindi in jwndn.json)
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
# [GESTIRE LA QUESTIONE DEI PRODOTTI NON DISPONIBILI]
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
Trovare un modo per determinare quando i prodotti non sono diponibili, eliminandoli dall inclusione del json oppure specificando il "non disponibile"
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
# [PARSARE IL NUMERO DI TELEFONO]
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
Per ora so soltanto chealla riga 870 dell html parsato, all interno di uno "< script >" C'è il numero di telefono in forma "allergenPhoneNumber":"3389529446" (o per lo meno così è per Aleppo). Trovare poi un moodo di visualizzarlo, quasi sicuramente nel "title" del json così da visualizzarlo acconto del nome del ristorante.
# [CALCOLARE E VISUALIZZARE IL PREZZO SINGOLO E TOTALE]
2022-09-27 18:59:50 +02:00
2022-10-04 15:48:53 +02:00
Trovare un modo per calcolare il prezzo del singolo user e il prezzo totale da dare al rider
2022-09-27 18:59:50 +02:00
2022-09-23 22:00:08 +02:00