Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

チャンネルを検索する前にサーバーに存在するチャンネルを一覧したい #14087

Open
1 task
fruitriin opened this issue Jun 24, 2024 · 4 comments
Labels
✨Feature This adds/improves/enhances a feature

Comments

@fruitriin
Copy link
Contributor

Summary

例えばこのようになっていると便利かもしれない
image

実行可能コード(ブラウザの開発ツール上)
texts = ""

// この辺はAPIのリクエストなのでなんでもよい
fetch("https://misskey.systems/api/channels/search", {
    "body": "{\"query\":\"\",\"type\":\"nameAndDescription\",\"limit\":100,\"allowPartial\":true,\"i\":\"あなたのAPIキー\"}",
    "cache": "default",
    "credentials": "omit",
    "headers": {
        "Accept": "*/*",
        "Accept-Language": "ja",
        "Cache-Control": "max-age=0",
        "Content-Type": "application/json",
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15"
    },
    "method": "POST",
    "mode": "cors",
    "redirect": "follow",
    "referrer": "https://misskey.systems/",
    "referrerPolicy": "origin"
}).then(async res => {

// 主な実装ここから
  const json = await res.json()
  console.log(json)
  
    json.sort((a, b) => { 
      console.log(new Date(a.lastNotedAt))
      return new Date(a.lastNotedAt) > new Date(b.lastNotedAt) ? -1 : 1 })
      json.forEach(channel => {
    // console.log(channel.name)
       texts += `${channel.name} (${channel.notesCount}) `
    })
  console.log(texts)
  document.querySelector(".xmspN").append(texts)
})

Purpose

検索するにしても何があるかわからないと検索が難しい
検索ワードなしですべてのチャンネルから検索できる実装になっていることがUIからわからない

Do you want to implement this feature yourself?

  • Yes, I will implement this by myself and send a pull request
@fruitriin fruitriin added the ✨Feature This adds/improves/enhances a feature label Jun 24, 2024
@fruitriin
Copy link
Contributor Author

げむすきだと863件のチャンネルがあったので、たとえば100件を越えるサーバーでも見やすい画面があるとうれしみがありそう

@fruitriin
Copy link
Contributor Author

スクリーンショット 2024-06-25 0 16 05
参考

@samunohito
Copy link
Member

UIの形はともかくとして、一覧の提供方法は #12977 で改善できそうな気がします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature
Projects
Status: No status
Development

No branches or pull requests

3 participants