Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [nicht gelöst] - [Hilfe] Google api - Kontakte Bilder holen von "google contacts"

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [nicht gelöst] - [Hilfe] Google api - Kontakte Bilder holen von "google contacts"

    This topic has been deleted. Only users with topic management privileges can see it.
    • bahnuhr
      bahnuhr Forum Testing Most Active last edited by

      Hallo,

      ich brauche mal Hilfe zu o.g. Thema.

      Bin schon seit Monate da dran; bekomme dies aber nicht hin.

      Auch versucht habe ich es mit dem tr-064 Adapter. Dieser zeigt ja die "imageurl" (auch von google) an.

      Diese funktioniert aber nicht (vgl. auch anderer Thread). Hatte auch ein issue eingestellt auf github beim tr064-Adapter und Kontakt mit soef.

      Antwort war: "Funktioniert nicht mit google".

      Ausgangslage:

      Habe meine sämtlichen Kontakte in google contacts gespeichert.

      Diese Kontakte habe ich auch als Telefonbuch in der Fritz.box (7490) eingebunden.

      iobroker läuft bei mir auf win7.

      Als Adapter habe ich installiert: fritz.box, tr-064, vcard

      Was habe ich vor:

      Wenn das Telefon klingelt geht bei mir auf dem tablet im wohnzimmer auf separate view auf wo dargestellt wird, wer anruft; Tel-Nr. und Name.

      Nun will ich zusätzlich das Bild (wenn vorhanden), was ja in google gespeichert ist (und auch irgendwo auf der fritzbox im Telefonbuch) mir holen und auf dem tablet darstellen.

      So stelle ich mir das vor:

      Es klingelt: Tel.Nr. und Name wird ermittelt durch o.g. Adapter

      Script: Bei google api anmelden und mit oauth2 oder simple-oauth (oder wie auch immer) registrieren.

      • bei google alle Kontakte mit Tel.Nr., Name, und Bild in einem json (z.B.) speichern

      • Das Bild dann runterladen und im image darstellen.

      • google auth wieder schießen.

      Könnt ihr mir da helfen ?

      Oder ist das zu viel für ein Script?

      mfg

      Dieter

      1 Reply Last reply Reply Quote 0
      • arteck
        arteck Developer Most Active last edited by

        verstehe ich nicht du weisst was du willst und es soll ein anderer für dich machen..cool…

        was hast du schon fertig ??

        1 Reply Last reply Reply Quote 0
        • bahnuhr
          bahnuhr Forum Testing Most Active last edited by

          @arteck

          Ja, es wäre cool wenn ich da Hilfe bekommen könnte.

          Ganz einfache Scripte bekomme ich hin; aber dieses hier ist zu hoch.

          Was habe ich gemacht:

          • Habe ewig lange bei google api reference gelesen. Aber so richtig komme ich da nicht durch.

          Welches Script ist das richtige?

          Welche api muss abonniert werden? Hab ich hier die richtige?

          • dann habe ich diesen thread gefunden?

          http://forum.iobroker.net/viewtopic.php?f=24&t=2300

          Und dort das Beispielscript:

          'use strict';
          
          const express = require('express');
          const simpleOauthModule = require('./../');
          
          const app = express();
          const oauth2 = simpleOauthModule.create({
            client: {
              id: '<client_id>',
              secret: '<client_secret>',
            },
            auth: {
              tokenHost: 'https://github.com',
              tokenPath: '/login/oauth/access_token',
              authorizePath: '/login/oauth/authorize',
            },
          });
          
          // Authorization uri definition
          const authorizationUri = oauth2.authorizationCode.authorizeURL({
            redirect_uri: 'http://localhost:3000/callback',
            scope: 'notifications',
            state: '3(#0/!~',
          });
          
          // Initial page redirecting to Github
          app.get('/auth', (req, res) => {
            console.log(authorizationUri);
            res.redirect(authorizationUri);
          });
          
          // Callback service parsing the authorization token and asking for the access token
          app.get('/callback', (req, res) => {
            const code = req.query.code;
            const options = {
              code,
            };
          
            oauth2.authorizationCode.getToken(options, (error, result) => {
              if (error) {
                console.error('Access Token Error', error.message);
                return res.json('Authentication failed');
              }
          
              console.log('The resulting token: ', result);
              const token = oauth2.accessToken.create(result);
          
              return res
                .status(200)
                .json(token);
            });
          });
          
          app.get('/success', (req, res) => {
            res.send('');
          });
          
          app.get('/', (req, res) => {
            res.send('Hello
          [Log in with Github](/auth)');
          });
          
          app.listen(3000, () => {
            console.log('Express server started on port 3000'); // eslint-disable-line
          });
          
          // Credits to [@lazybean](https://github.com/lazybean)</client_secret></client_id>
          

          Habe dann versucht das Script zu verstehen; war mir aber bisher zu hoch.

          Fazit:

          Es könnte ja sein, dass schon jemand dies mit dem simple-oauth2 probiert und hinbekommen hat.

          Oder irgendwie anders; ein guter verständlicher link würde mir auch reichen.

          mfg und schöne Weihnachten

          Dieter

          1 Reply Last reply Reply Quote 0
          • bahnuhr
            bahnuhr Forum Testing Most Active last edited by

            Ich kennzeichne den Artikel mal als [nicht gelöst].

            Ist schade, dass hierbei keine Reaktion mehr erfolgt.

            Falls doch noch jemand eine Idee oder Lösung oder Vorschlag hat kann ich die Kennzeichnung ja wieder ändern.

            mfg

            Dieter

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            707
            Online

            31.9k
            Users

            80.2k
            Topics

            1.3m
            Posts

            2
            4
            728
            Loading More Posts
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes
            Reply
            • Reply as topic
            Log in to reply
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
            The ioBroker Community 2014-2023
            logo