web-dev-qa-db-ja.com

各「購読解除」ボタンをクリックせずに、すべてのサブレディットから同時に購読解除するにはどうすればよいですか?

下のスクリーンショットは、タイトルの質問を示しています。

enter image description here

私の試み

Reddit から次の2つのスクリプトをURLバーに入力しましたが、FirefoxとChromeは、Googleの検索と誤解して、問題を解決できませんでした。

警告ブラウザの履歴をクリアした場合、これを元に戻す方法はありません

このページmultiredditリンク をクリックします。それをクリックしてリダイレクトされたら、これをアドレスバーに貼り付けてEnterキーをクリックします。

javascript:(function(){var%20q=[];$('.remove').each(function(){var%20that=this;var%20f=function(index){$(that).trigger('click');$(that).trigger('mousedown');setTimeout(function(){if(q[index]){q[index](index+1);}else{if(downVoteTimer){window.clearTimeout(upVoteTimer);}}},500);};q.Push(f);});var%20downVoteTimer=window.setTimeout(function(){q[0](1);},50);}());

スクリプト#2

代わりにこれを使ってみてください:

javascript:(function(){var%20q=[];$('.remove').each(function(){var%20that=this;var%20f=function(index){$(that).trigger('click');$(that).trigger('mousedown');setTimeout(function(){if(q[index]){q[index](index+1);}else{if(downVoteTimer){window.clearTimeout(upVoteTimer);}}},500);};q.Push(f);});var%20downVoteTimer=window.setTimeout(function(){q[0](1);},50);}());

Chromeはjavascript:パーツを自動的に削除する可能性があるため、手動で再追加する必要があります

私は完全にあなたの質問を理解していません。 このリンク に移動し、開発者ツールを開いてコンソールに配置します

javascript:(function(){var q=[];$('.remove').each(function(){var that=this;var f=function(index){$(that).trigger('click');$(that).trigger('mousedown');setTimeout(function(){if(q[index]){q[index](index+1);}else{if(downVoteTimer){window.clearTimeout(upVoteTimer);}}},500);};q.Push(f);});var downVoteTimer=window.setTimeout(function(){q[0](1);},50);}());

それが機能しない場合は、これに従って link を実行し、他の解決策を試すことができます

1
jibeeeee

PythonおよびPRAW(Python Reddit API wrapper- https://praw.readthedocs.io/en/latest/ )と呼ばれるRedditのAPIラッパー)を使用すると、単にあなたの目標を達成することができます。

import praw
reddit = praw.Reddit('user', user_agent='Bulk Unsubscribe Script') #Getting credentials from praw.ini file.
for subreddit in reddit.user.subreddits(limit=None):
    subreddit.unsubscribe()

以前のPRAWドキュメントへのリンクをたどると、RedditアカウントのAPIアクセスを設定する方法(非常に簡単-Redditの設定/設定パネルから行うことができます)とそれにログインする方法が説明されます。

0
Max A.