Skip to content

Commit

Permalink
refs #14 DaaS APIの向き先を新ドメインに変更 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
averak authored Jan 28, 2024
1 parent 969bbe2 commit cea2417
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/slack.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var JUDGE_API_BASE_URL = "https://api.abelab.dev/";
var JUDGE_API_BASE_URL = "https://daas.abelab.dev/";

function slack2SheetPost(jsonObj, score, isSlash, includeSensitive, mode) {
// スプレットシートに記述する
Expand Down Expand Up @@ -116,7 +116,7 @@ function addReaction(channel, ts, emoji) {
}

function accessJudgeApi(joke, base_url) {
const apiUrl = "daas/judge?dajare=";
const apiUrl = "judge?dajare=";
const response = UrlFetchApp.fetch(
base_url + apiUrl + joke.replace(/%3A[^(%3A)]+%3A+/g, "")
).getContentText();
Expand All @@ -125,7 +125,7 @@ function accessJudgeApi(joke, base_url) {
}

function accessEvaluateApi(joke, base_url) {
const apiUrl = "daas/eval?dajare=";
const apiUrl = "eval?dajare=";
const response = UrlFetchApp.fetch(
base_url + apiUrl + joke.replace(/%3A[^(%3A)]+%3A+/g, "")
).getContentText();
Expand All @@ -134,7 +134,7 @@ function accessEvaluateApi(joke, base_url) {
}

function accessKatakanaApi(joke, base_url) {
const apiUrl = "daas/reading/?dajare=";
const apiUrl = "reading/?dajare=";
const response = UrlFetchApp.fetch(
base_url + apiUrl + joke.replace(/%3A[^(%3A)]+%3A+/g, "")
).getContentText();
Expand All @@ -144,9 +144,9 @@ function accessKatakanaApi(joke, base_url) {

function accessAllApi(joke, base_url) {
const nonEmojiJoke = joke.replace(/%3A[^(%3A)]+%3A+/g, "");
const judgeUrl = base_url + "daas/judge?dajare=" + nonEmojiJoke;
const evaluateUrl = base_url + "daas/eval?dajare=" + nonEmojiJoke;
const katakanaUrl = base_url + "daas/reading/?dajare=" + nonEmojiJoke;
const judgeUrl = base_url + "judge?dajare=" + nonEmojiJoke;
const evaluateUrl = base_url + "eval?dajare=" + nonEmojiJoke;
const katakanaUrl = base_url + "reading/?dajare=" + nonEmojiJoke;

const response = UrlFetchApp.fetchAll([judgeUrl, evaluateUrl, katakanaUrl]);
const judgeJson = JSON.parse(response[0].getContentText());
Expand Down

0 comments on commit cea2417

Please sign in to comment.