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

Let our hubot retrieve random image from http://zzal.coroke.net #26

Open
chitacan opened this issue Jan 26, 2015 · 1 comment
Open

Let our hubot retrieve random image from http://zzal.coroke.net #26

chitacan opened this issue Jan 26, 2015 · 1 comment

Comments

@chitacan
Copy link
Contributor

http://zzal.coroke.net has many zzal(:camera: ) posted by user.
It's way more accrate than our google search based image or idols scripts. (but, it's less naughty 😢)

with following hack, we can retrieve some image url from this site.

http://zzal.coroke.net works with keyword. http://zzal.coroke.net/<keyword> response an html document with image urls.

For example, http://zzal.coroke.net/iu url will response following html. We can get url with evaluating IMGURLS variable.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>아이유 - zzal.coroke.net</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="apple-mobile-web-app-capable" content="yes">
            <meta name="apple-mobile-web-app-status-bar-style" content="black">
                <link href="//cfile9.uf.tistory.com" rel="dns-prefetch" />
                <link href="//cfs16.tistory.com" rel="dns-prefetch" />

<scripts>
var IMGURLS=[[42,'http://cfile9.uf.tistory.com/original/141BC33D509D63240985A1'],[44,'http://cfs16...
</scripts>

cheerio can help us to parse this html response

But with invalid keyword (ex, http://zzal.coroke.net/전성균) will redirect to main page

How can we get valid keyword? Just send post request to http://zzal.coroke.net/search.do with keyword parameter.

keyword=<YOUR_KEYWORD>

If site has related keyword, you can get one in response. If not, response should be empty string.

Following command is suitable for this job ✨

hubot zzal <keyword>
@imazine
Copy link
Contributor

imazine commented Jan 26, 2015

This keyword is so great step for our history!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants