Compare commits
No commits in common. "eb13ce2e412859fb9601ec19538504495457c4a9" and "a7fa593d15637515aa4e16fc787fefb257ebf9f8" have entirely different histories.
eb13ce2e41
...
a7fa593d15
6 changed files with 3741 additions and 41 deletions
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 Matyáš Caras
|
Copyright (c) 2022 Matyáš Caras and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
27
README.md
27
README.md
|
@ -12,34 +12,7 @@ Experimentální **neoficiální** webscrape knihovna pro komunikaci se systéme
|
||||||
## To do
|
## To do
|
||||||
- Kompatibilita se staršími verzemi iCanteen
|
- Kompatibilita se staršími verzemi iCanteen
|
||||||
|
|
||||||
Příklad používání [zde](https://git.mnau.xyz/hernik/canteenlib/src/branch/main/example/canteenlib_example.dart)
|
|
||||||
|
|
||||||
*\* Knihovna nemusí fungovat na všech instancích systému iCanteen, proto žádám každého, kdo může a je uživatelem iCanteen, aby otestoval funkčnost této knihovny a případné problémy [nahlásil](https://git.mnau.xyz/hernik/canteenlib/issues/new)*
|
*\* Knihovna nemusí fungovat na všech instancích systému iCanteen, proto žádám každého, kdo může a je uživatelem iCanteen, aby otestoval funkčnost této knihovny a případné problémy [nahlásil](https://git.mnau.xyz/hernik/canteenlib/issues/new)*
|
||||||
|
|
||||||
### Otestované instance iCanteen
|
### Otestované instance iCanteen
|
||||||
[zde](https://git.mnau.xyz/hernik/canteenlib/src/branch/main/COMPATIBILITY.md)
|
[zde](https://git.mnau.xyz/hernik/canteenlib/src/branch/main/COMPATIBILITY.md)
|
||||||
|
|
||||||
## Licence
|
|
||||||
```
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 Matyáš Caras
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
```
|
|
|
@ -1,15 +1,20 @@
|
||||||
import 'package:canteenlib/canteenlib.dart';
|
import 'package:canteenlib/canteenlib.dart';
|
||||||
|
|
||||||
void main(List<String> args) async {
|
void main(List<String> args) {
|
||||||
Canteen c = Canteen(
|
Canteen c = Canteen("https://kantyna.neco.cz");
|
||||||
"https://kantyna.neco.cz"); // vytvořit instanci kantýny, všechna komunikace probíhá skrz ni
|
c.login("uzivatel", "heslo").then((value) {
|
||||||
try {
|
c.jidelnicekDen(den: DateTime.parse("2022-04-04")).then((t) async {
|
||||||
await c.login("uzivatel", "heslo"); // přihlásit se
|
print((await c.ziskejUzivatele()).kredit);
|
||||||
var jidelnicek = await c.jidelnicekDen(den: DateTime.parse("2022-04-04"));
|
c.objednat(t.jidla[0]).then(
|
||||||
print((await c.ziskejUzivatele()).kredit);
|
(value) {
|
||||||
var objednano = await c.objednat(jidelnicek.jidla[0]);
|
t.jidla[0] = value; // divně udělané ale nic lepšího teď nevymyslím
|
||||||
print(objednano.objednano);
|
print(t.jidla[0].objednano);
|
||||||
} catch (e) {
|
print(t.jidla[0].orderUrl);
|
||||||
print("Při získávání informací nastala chyba: $e");
|
},
|
||||||
}
|
);
|
||||||
|
});
|
||||||
|
}).catchError((o) {
|
||||||
|
print(o);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,7 +303,7 @@ class Canteen {
|
||||||
.replaceAll(" <br>", "")
|
.replaceAll(" <br>", "")
|
||||||
.replaceAll("\n", "");
|
.replaceAll("\n", "");
|
||||||
var alergeny =
|
var alergeny =
|
||||||
RegExp(r"""<span title=".+?" class="textGrey">(.+?)<\/span>""")
|
RegExp(r"""<span title=".+?" class="textGrey">([a-zA-Z]*)<\/span>""")
|
||||||
.allMatches(jidlaProDen)
|
.allMatches(jidlaProDen)
|
||||||
.toList();
|
.toList();
|
||||||
var vydejna = RegExp(
|
var vydejna = RegExp(
|
||||||
|
|
3712
package-lock.json
generated
Normal file
3712
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
10
package.json
Normal file
10
package.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"cz-conventional-changelog": "^3.3.0"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"commitizen": {
|
||||||
|
"path": "./node_modules/cz-conventional-changelog"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in a new issue