Upgrade to Pro — share decks privately, control downloads, hide ads and more …

天気アプリ1

Avatar for junichi junichi
April 28, 2022

 天気アプリ1

Avatar for junichi

junichi

April 28, 2022

More Decks by junichi

Other Decks in Technology

Transcript

  1. εΫϦϓτΛهೖ͠Α͏ function doGet(){ const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet =

    ss.getSheetByName('ఱؾ஍఺'); const areaURL = sheet.getRange('A2').getValue(); let getUrl = areaURL; let weatherData = UrlFetchApp.fetch(getUrl).getContentText('UTF-8'); let today_data = Parser.data(weatherData).from('<div id="yjw_pinpoint_today">').to('</div>').build(); let tmr_data = Parser.data(weatherData).from('<div id="yjw_pinpoint_tomorrow">').to('</div>').build(); let html = HtmlService.createTemplateFromFile('index'); html.today_data = today_data; html.tmr_data = tmr_data; return html.evaluate().setTitle('ఱؾΞϓϦ'); } ίʔυ.js <!DOCTYPE html> <html> <head> <base target="_top"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&display=swap" rel="stylesheet"> <style> body{ font-family: 'Mochiy Pop One', sans-serif; font-size:100%; height:250px; } @page { size: A4 landscape; margin: 0mm; } </style> </head> <body> <div div="page" style="width: 210mm;box-sizing: border-box; margin:10px auto;"> <?!= today_data ?> <?!= tmr_data ?> <a id="btn" style="padding:20px; float:right; font-size:20px;" href="javascript:void(0)" onclick="window.print(); return false;">ҹ࡮͢Δ</a> </div> </body> </html>
  2. <!DOCTYPE html> <html> <head> <base target="_top"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link

    rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&display=swap" rel="stylesheet"> <style> body{ font-family: 'Mochiy Pop One', sans-serif; font-size:100%; height:250px; } @page { size: A4 landscape; margin: 0mm; } </style> </head> <body> <div div="page" style="width: 210mm;box-sizing: border-box; margin:10px auto;"> <?!= today_data ?> <?!= tmr_data ?> <a id="btn" style="padding:20px; float:right; font-size:20px;" href="javascript:void(0)" onclick="window.print(); return false;">ҹ࡮͢Δ</ a> </div> </body> </html> εΫϦϓτΛهೖ͠Α͏ index.html