Skip to content

Instantly share code, notes, and snippets.

@peccu
Forked from toshia/pattern_file.json
Created November 16, 2011 14:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peccu/1370197 to your computer and use it in GitHub Desktop.
Save peccu/1370197 to your computer and use it in GitHub Desktop.
写真アップロードサービスのURLから画像のURLを得るためのマッチ条件
{
"twitpic": {
"url": "^http://twitpic\\.com/[a-zA-Z0-9]+",
"attribute": {
"id": "photo-display"
}
},
"yfrog": {
"url": "^http://yfrog\\.com/[a-zA-Z0-9]+",
"attribute": {
"id": "main_image"
}
},
// "twipple photo": {
// "url": "^http://p\\.twipple\\.jp/[a-zA-Z0-9]+",
// "attribute": {
// "id": "post_image"
// }
// },
"twipple": {
"url": "^http://p\\.twipple\\.jp/(\w+)",
"imgurl":"http://p.twipple.jp/show/orig/$1"
},
"moby picture": {
"url": "^http://moby.to/[a-zA-Z0-9]+",
"attribute": {
"id": "main_picture"
}
},
"lockerz": {
"url": "^http://lockerz\\.com/s/[0-9]+",
"attribute": {
"id": "photo"
}
},
"gyazo": {
"url": "^http://gyazo.com/[a-zA-Z0-9]+",
"attribute": {
"id": "gyazo_img"
}
},
"携帯百景": {
"url": "^http://movapic.com/(?:[a-zA-Z0-9]+/pic/d+|pic/[a-zA-Z0-9]+)",
"attribute": {
"class": "image",
"src": {
"json_class": "Regexp",
"data": "^http://image\\.movapic\\.com/pic/"
}
}
},
"piapro": {
"url": "^http://piapro.jp/t/[a-zA-Z0-9]+",
"attribute": {
"tag": "meta",
"attribute": "content",
"content": {
"json_class": "Regexp",
"data": "^http://[a-z0-9]+?\\.piapro.jp/timg/[a-zA-Z0-9_]+?_0500_0500\\.(jpg|png|gif)"
}
}
},
"Flickr": {
"url": "^http://www\\.flickr\\.com/photos/[a-zA-Z0-9_]+/\\d+",
"attribute": {
"src": {
"json_class": "Regexp",
"data": "^http://farm\\d+\\.static\\.flickr\\.com/\\d+/[a-zA-Z0-9_]+\\.jpg"
}
}
},
"Instagram": {
"url": "^http://instagr.am/p/[a-zA-Z0-9_]+",
"attribute": {
"class": "photo"
}
}
}
@peccu
Copy link
Author

peccu commented Nov 16, 2011

この辺を対応したい
http://blog.irons.jp/2009/12/23/twitter_thumb_url/

というか手元のPHPでは対応してるはずだからこっちのjsonフォーマットに書き換えたい

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