1212
1313trait GermanTraits
1414{
15+
16+ private function loadJson ($ url ){
17+ $ client = new \GuzzleHttp \Client ();
18+ $ guzzle = $ client ->request ('get ' , $ url );
19+
20+ return json_decode ($ guzzle ->getBody (), true );
21+ }
1522 /**
1623 * @param $json
1724 */
@@ -25,7 +32,6 @@ private function createRSSItem($json, $city): void
2532 $ className = '\App\RSSItems \\' . $ city . 'RSSItem ' ;
2633 $ RSSitem = new $ className ;
2734
28-
2935 $ RSSitem ->uid = $ item ['uid ' ];
3036 $ RSSitem ->title = $ item ['title ' ];
3137 $ RSSitem ->description = $ item ['description ' ];
@@ -41,7 +47,7 @@ private function createRSSItem($json, $city): void
4147 $ RSSitem ->user_publicEmail = $ item ['user ' ]['publicEmail ' ];
4248 $ RSSitem ->user_type = $ item ['user ' ]['type ' ]['identifier ' ] ?? '' ;
4349 $ RSSitem ->user_website = $ item ['user ' ]['www ' ];
44- $ RSSitem ->activity_type = $ item ['type ' ]['identifier ' ];
50+ $ RSSitem ->activity_type = $ item ['type ' ]['identifier ' ] ?? ' invite-in-person ' ;
4551 $ RSSitem ->tags = trim (implode ("; " , Arr::pluck ($ item ['tags ' ], 'title ' )));
4652 $ RSSitem ->themes = trim (implode (", " , Arr::pluck ($ item ['themes ' ], 'identifier ' )));
4753 $ RSSitem ->audience = trim (implode (", " , Arr::pluck ($ item ['audience ' ], 'identifier ' )));
0 commit comments