0

2 つの reddit ユーザー名とそのパスワードを指定して、user1 が購読しているすべての subreddit に user2 を購読する Web ページを作成したいと思います。だから私はする必要があります:

  1. user1 が購読している subreddits を取得します。
  2. user2 をこれらの reddit に登録します

PHP の使用経験はありますが、スクレイピング (特にユーザーがログインする必要がある場合) や、ユーザーを subreddit に「サブスクライブ」するために必要な種類の情報を送信する経験はありません。これをどのように行うことができるかについて誰にもアイデアがありますか?

よろしく、

ティム

4

2 に答える 2

1

これが reddits の利用規約に違反していないと仮定すると、ログインに使用すると、おそらく必要な情報をcURL簡単に取得できます。regexそこから、reddit がどのようにお気に入りをサブスクライブしているかを確認し、適切な URL に移動するか、フォーム データを投稿するかを確認する必要があります。

redditの利用規約に反しない限り、私はそれを中レベルのタスクと呼んでいます.

于 2010-02-13T06:00:18.067 に答える
0

オープン ソース製品のTestPlanは、このような点で非常に優れています。簡単な言語を使用して、1 人のユーザーでサイトにログインし、subreddits の名前を取得してから、別のユーザーとしてログインしてグループに登録できます。

たとえば、トップ エントリのタイトルだけが必要な場合は、次のコードを使用できます。

GotoURL http://www.reddit.com/top/

set %Topics% as response //p[@class='title']
foreach %Topic% in %Topics%
    set %Title% as selectIn %Topic% string(.)
    Notice %Title%
end

次のような出力が生成されます。

00000000-00 GOTOURL http://www.reddit.com/top/
00000001-00 NOTICE LEGAL DVD vs. PIRATED COPY (i.imgur.com)
00000002-00 NOTICE Don't just shorten your URL, make it suspicious and frightening. - ShadyURL (shadyurl.com)
00000003-00 NOTICE HOLY CRAP! IS THAT A ROOM FOR RENT ON MY CRAIGSLIST??!?!? (houston.craigslist.org)
00000004-00 NOTICE Years from now when our children ask us, "What did we do after 9/11?" we shall explain it to them using this... (4gifs.com)
00000005-00 NOTICE TSA forces disabled boy to remove leg braces and walk through the metal detector. "I told him, 'This is overkill. He's 4 years old. I don't think he's a terrorist.' " (philly.com)
00000006-00 NOTICE This picture scares the shit out of me. (imgur.com)
00000007-00 NOTICE Civilization V Announced, in Development at Firaxis Games (hellforge.gameriot.com)
00000008-00 NOTICE I don't know, the price seems a little steep... [pic] (i.imgur.com)
00000009-00 NOTICE Reddit, last week we saw the depth of the ocean scaled relative to human size. I made a figure of the depth of the ocean accurately scaled to the width. It's really very shallow from this perspective. (i.imgur.com)
于 2010-02-19T14:13:18.850 に答える