0

我需要打开一个新的 google 会议室,然后发送。我不能在应用程序中使用标准的“分享”按钮。我需要抓住最终的网址。我无法用 curl 捕捉到它(这不是正常的重定向)。我的想法是我需要在后台或同一页面中打开一个请求/链接,稍等片刻并抓住链接,然后我可以释放页面并且用户可以进入。

你知道什么可以帮助我吗?

编辑:是的,我错过了告诉我需要通过单击生成一个房间并从代码中捕获 url。一般来说,我应该用谷歌日历 API 来做这个,但在这种情况下我不能。

4

2 回答 2

1

我使用谷歌日历 API。我为我的组织制作了一个 webApp,它从一个表单(带有要发送 togheter meet 链接的用户信息)使用 google 会议室(来自 google 登录用户帐户)制作一个 google 日历事件,捕获链接并通过 smsGateway 发送它。

        function FormForMeet (Args) {
    
    // get calendar name, if it already exists
    var meetsCalendar = CalendarApp.getCalendarsByName ('CalendarName');
      Logger.log (meetsCalendar.length)
    
      if (meetsCalendar.length> = 1) {
// if some calendar be found, it catch the first, obviously here you can use some differet method. I had choose this because I don't expect to find more than 1
        var calendar = meetsCalendar [0] .getId ();
      }
      else
      {
    // If miss, create new one.
        var calendar = CalendarApp.createCalendar ('CalendarName', {summary: 'descrip Calendar',
// set a color of calendar label :D
        color: CalendarApp.Color.PURPLE});
        calendar = calendar.getId ();
      }
      
    // Call function to create meet
     var LinkMeet = CreateConference_ (calendar);
     
// here you can use what you want for send Args + LinkMeet);
    
    // if you want return link
     return LinkMeet;
    }

    // Function to create Conference. You can obviously use the code up without make a new function.
    function CreateConference_ (calendarId) {
    
    // Custom of event, here I created the conferences according to my needs (now, with 1 h / conference)
      var now = new Date ();
      var start = new Date (now.getTime ()). toISOString ();
      var end = new Date (now.getTime () + (1 * 60 * 60 * 1000)). toISOString ();
// generate random string to request
      var rdmreqId = genStrg ();
    
      var event = {
      "end": {
         "dateTime": end
         
      },
      "start": {
        "dateTime": start
         
      },
      "summary": "conferenceName",
      "conferenceData": {
        "createRequest": {
          "conferenceSolutionKey": {
            "type": "hangoutsMeet"
          },
          "requestId": rdmreqId
        }
      }
    
      };
    // insert event in calendar
     event = Calendar.Events.insert (event, calendarId, {
        "conferenceDataVersion": 1});
    // if use the function you can return the link to send
      return event.hangoutLink
    }
    // random strind
    function genStrg () {
      var data = "something";
      var text = "";
      var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789! @ # $% & <> * -";
    
      for (var j = 2; j <= data.length; j ++) {
        text = ""; // Reset text to empty string
    
        for (var i = 0; i <possible.length; i ++) {
          text + = possible.charAt (Math.floor (Math.random () * possible.length));
        }
    
        return text;
      }
    }
于 2020-12-06T10:48:06.233 回答
0

所有 google meet 链接看起来都像这样: https://meet.google.com/abc-defg-hij 您应该能够从浏览器页面复制并粘贴此链接。如果有人进入此链接,他们将被带到会议大厅,他们可以随时进入。

如果您由于某种原因无法访问此链接,例如您使用移动设备,则必须将您的见面代码 (the abc-defg-hij) 放在上述网址的末尾。

编辑:如果您在移动设备上,您实际上可以通过进入会议大厅并向下滚动直到“加入信息”找到该链接。在此之下应该有会议链接和通过电话加入的号码。

于 2020-11-11T07:26:01.180 回答