반응형

요즘 다들 AI  개발과 홍보에 열중이고

ChatGPT 이후 여러 회사에서 앞다투어 서비스 중.

 

Bard 도 이러한 시류에 맞게 구글에서 만든 AI서비스

https://bard.google.com/

 

Bard

Bard is your creative and helpful collaborator to supercharge your imagination, boost productivity, and bring ideas to life.

bard.google.com

아직 한글은 지원하지 않지만

이걸로 뭘 할수 있을까 생각해보다

 

"구글 AI 로 유투브 광고 차단해볼까?" 라는 생각이들었다..

그래 언제나 그런거지...


영어로 질문해야 되니 구글 번역기 ㄱㄱ 

 

자 이제 Bard에 넣으면...

 

// manifest.json
{
  "name": "YouTube Ad Blocker",
  "version": "1.0",
  "description": "Blocks all ads on YouTube",
  "manifest_version": 2,
  "content_scripts": [
    {
      "matches": ["https://www.youtube.com/*"],
      "js": ["contentscript.js"]
    }
  ],
  "permissions": ["tabs", "https://www.youtube.com/*"]
}
// contentscript.js
// This file is loaded into every YouTube page.

chrome.webRequest.onHeadersReceived.addListener(
  function(details) {
    if (details.url.indexOf("youtube.com") !== -1) {
      // Check if the request is for an ad.
      if (details.requestHeaders["x-goog-ad-client"] !== undefined) {
        // Block the request.
        details.cancel();
      }
    }
  },
  {
    urls: ["*://*/*"],
    types: ["main_frame"]
  },
  ["blocking"]
);

응?...????

어...음...그러니까...

뭘 어쩌라는거지????

물어봐야지뭐...

 

어....블록하는건 나도 알아...저 코드 어떻게 쓰냐고...

 

코드를 넣고 "how to use" 를 마지막에 쓴다는게 잘못해서 코드만 넣었다...

 

으잉???

옹...시키는대로 해보자...

 

Save the code above as manifest.json and contentscript.js in a new folder.

1. 바탕화면에 test1 폴더를 만들고

1-2. 코드를 각각 파일로 저장

 

manifest.json

// manifest.json
{
  "name": "YouTube Ad Blocker",
  "version": "1.0",
  "description": "Blocks all ads on YouTube",
  "manifest_version": 2,
  "content_scripts": [
    {
      "matches": ["https://www.youtube.com/*"],
      "js": ["contentscript.js"]
    }
  ],
  "permissions": ["tabs", "https://www.youtube.com/*"]
}

contentscript.js

// contentscript.js
// This file is loaded into every YouTube page.

chrome.webRequest.onHeadersReceived.addListener(
  function(details) {
    if (details.url.indexOf("youtube.com") !== -1) {
      // Check if the request is for an ad.
      if (details.requestHeaders["x-goog-ad-client"] !== undefined) {
        // Block the request.
        details.cancel();
      }
    }
  },
  {
    urls: ["*://*/*"],
    types: ["main_frame"]
  },
  ["blocking"]
);

Open Chrome and go to 'chrome://extensions'.

2. 크롬 주소창에 확장 프로그램 주소를 넣고

Enable Developer mode.
Click on Load unpacked extension and select the folder where you saved the code.

3. 개발자 모드 활성화 하고

4. "압축해제된 확장 프로그램을 로드합니다" 클릭후 생성한 폴더 선택

 

The extension will be installed and enabled.

5. 확장프로그램이 유효화

오오....

 

Go to YouTube.
You should now see that all ads have been blocked.

6. 유투브로 가면

7. 광고 블럭 된다..

 

오오!!!

광고 블락이라매!!

응????? 네????

설마.....크롬 재시작 해야 되나?;;;

역시나....

 

크롬 종료??후 다시 시작하니 정상적으로 (동작??) 광고가 안나온다..

오....이걸로 트위치 광고제거도 만들수 있으려나??? 한번 해봐야겠다...


결론 

- 생각한걸 만들수 있었다.

- 용어를 모르면 만들기 어렵지 않을까.(확장프로그램, 크롬 등등)

- 간단한 작업(?)들은 손쉽게 된다.

- ChatGPT 처럼 이어서 질문이 안되니 이상한 답이 나오기도 한다.

 

 

 

 

반응형
반응형

뭐 회사 일까지는 아니고 개인적으로 각 차트의 순위를 보려고 만듬


1. 파이선으로 웹 에서 정보 가져옴

2. txt 파일로 만듬

3. 엑셀에서 읽옴

4. 각 날자별 시트 생성후 저장

5. 함수 적절히 해서 순위 나오게 함



함수는 

=IFERROR(MATCH(C$4,INDIRECT("'"&$F113&IF($G$3="안드로이드"," and"," ios")&"'"&"!"&CHAR(64+MATCH(G$5,INDIRECT("'"&$F113&IF($G$3="안드로이드"," and"," ios")&"'"&"!$1:$1"),0))&":"&CHAR(64+MATCH(G$5,INDIRECT("'"&$F113&IF($G$3="안드로이드"," and"," ios")&"'"&"!$1:$1"),0))),0)-1,IFERROR(MATCH(C$4,INDIRECT("'"&$F113&IF($G$3="안드로이드"," and"," ios")&"'"&"!"&CHAR(64+MATCH(H$5,INDIRECT("'"&$F113&IF($G$3="안드로이드"," and"," ios")&"'"&"!$1:$1"),0))&":"&CHAR(64+MATCH(H$5,INDIRECT("'"&$F113&IF($G$3="안드로이드"," and"," ios")&"'"&"!$1:$1"),0))),0)-1,"없음"))


매크로 하기 싫어서 함수로 하니 괘랄한 아이가 나옴 ㅋㅋㅋㅋㅋㅋㅋ


나중에 정보확인용으로 저장~


중간에 주말 데이터가 없는건 일자 변경시 자동기능 않넣어서 그럼 ㅋㅋㅋㅋ 


나만볼껀데 뭐 상관없지 ㅋㅋㅋㅋ


어라? 근데 용량 겁나 작네...쳇...



반응형

+ Recent posts