{"id":642,"date":"2009-08-04T22:47:40","date_gmt":"2009-08-04T14:47:40","guid":{"rendered":"http:\/\/www.impjq.net\/blog\/2009\/08\/04\/%e8%84%9a%e6%9c%ac\/"},"modified":"2009-08-04T22:47:40","modified_gmt":"2009-08-04T14:47:40","slug":"%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/pjq.me\/?p=642","title":{"rendered":"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09"},"content":{"rendered":"<p>\u5c06\u811a\u672c\u6574\u5408\u4e86\u4e00\u4e0b\uff0c\u66f4\u591a\u6d4b\u8bd5\u529f\u80fd\u8fd8\u5728\u8fdb\u4e00\u6b65\u5b8c\u5584\u4e2d\u3002<br \/>\n\u4e0b\u8f7d\u6e90\u7801\uff1a<a href=\"http:\/\/github.com\/pjq\/FlickrShell\/tree\/master\">http:\/\/github.com\/pjq\/FlickrShell\/tree\/master<\/a><\/p>\n<p>1.\u65b0\u589e\u4e86\u914d\u7f6e\u6587\u4ef6:flickr.conf,\u5c06\u4f60\u7684API_KEY\u53ca\u5bc6\u94a5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u597d\uff0c\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u8fd0\u884c\uff0c\u4f1a\u81ea\u52a8<br \/>\n\u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u8fdb\u884c\u76f8\u5e94\u7f16\u8f91\u5c31\u884c\u4e86\u3002<br \/>\n\u65b0\u521b\u5efa\u7684\u6587\u4ef6\u5f62\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre lang=\"java\" line=\"1\">\npjq@gentoo-pjq ~\/flickr $ cat flickr.conf\nAPI_KEY=\nAPI_SECRET=\nOUTPUTDIR=.\/xml\nTOKEN=\n<\/pre>\n<p>2.\u5c06\u4e0b\u8f7d\u7684\u4e34\u65f6\u6587\u4ef6\u9ed8\u8ba4\u653e\u5728\u5f53\u524d\u76ee\u5f55\u4e0b(.\/xml)\uff0c\u8fd9\u4e2a\u8def\u5f84\u4f60\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u4fee\u6539<br \/>\n3.\u83dc\u5355\u7528\u7684\u662fwhile\u8bed\u53e5\uff0c\u53ea\u8981\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u201cq\u201d\u5c31\u4f1a\u4e00\u76f4\u5faa\u73af;\u5e76\u4e14\u5305\u542b\u6709\u5b50\u83dc\u5355\uff0c\u5728\u5b50\u83dc\u5355\u4e2d\u8f93\u5165<br \/>\n&#8220;q&#8221;\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u4e0a\u4e00\u7ea7\u83dc\u5355\uff08\u73b0\u5728\u8fd8\u4e0d\u80fd\u786e\u8ba4\uff0c\u53ea\u662f\u73b0\u5728\u770b\u5230\u7684\u5c31\u662f\u8fd9\u79cd\u6548\u679c\uff0c\u5f53\u7136\u6211\u8fd9\u91cc\u53ea\u67092\u7ea7<br \/>\n\u83dc\u5355\uff09<\/p>\n<p>4.\u66f4\u591aAPI\u529f\u80fd\u518d\u6162\u6162\u5b8c\u5584\uff0c\u8981\u67e5\u770b\u73b0\u6709\u54ea\u4e9b\u529f\u80fd\uff0c\u53ea\u8981\u542f\u52a8\u7a0b\u5e8f\u8fdb\u5165\u5230\u4e3b\u83dc\u5355\u4e2d\u5c31\u4f1a\u5217\u51fa\u6765\u4e86\u3002<\/p>\n<pre lang=\"java\" line=\"1\">\n*******Main Menu(Flickr.com)**************************************\nPlease select your action:\n1.Get Info\n2.Get blog list\n3.Get services list\n4.Post a photo to your blog\n5.Get Commons Institutions\n6.Get Contact list(including recently upload and public list)\n7.Group Operations\n              =&gt;&gt;Have sub menu\n8.Get interestingness list\n9.machinetags operation\n              =&gt;&gt;Have sub menu\nh.Enter this for help information\nq.Enter this to exit\n\n\n<\/pre>\n<p>\u811a\u672c\u6e90\u4ee3\u7801\uff1a<br \/>\n<!--more--><\/p>\n<pre lang=\"java\" line=\"1\">\n\n#########################################################################\n# Author: pengjianqing@gmail.com\n# Created Time: Mon 03 Aug 2009 07:48:46 PM CST\n# File Name: flickr.sh\n# Description:Please visit www.impjq.net for more information about this shell.\n#########################################################################\n#!\/bin\/bash\n\nalias wget=='wget -b'\nCONFIGFILE=flickr.conf\n\necho \"config file=${CONFIGFILE}\"\nAPI_KEY=`grep -v \"#\" ${CONFIGFILE}|grep API_KEY |cut -d \"=\" -f2`\nAPI_SECRET=`grep -v \"#\" ${CONFIGFILE}|grep API_SECRET|cut -d \"=\" -f2`\nOUTPUTDIR=`grep -v \"#\" ${CONFIGFILE}|grep OUTPUTDIR|cut -d \"=\" -f2`\n\nTOKENXML=token.xml\nFROBXML=frob.xml\nINFOXML=info.xml\nBLOGLISTXML=bloglist.xml\nPOSTBLOGRESULTXML=postblogresult.xml\nSERVICESLISTXML=serviceslist.xml\nCOMMONSINSTITUTIONSXML=commonsinstitutions.xml\nCONTACTLIST=contactlist.xml\nCONTACTLISTPUBLICLIST=contactlistpublislist.xml\nCONTACTLISTRECENTUPLOAD=contactlistrecentupload.xml\n\n#Groub\nGROUPBROWSERXML=groupbrowser.xml\nGROUPSEARCHXML=groupsearchbrowser.xml\nGROUPINFOXML=groupinfo.xml\nGROUPMEMBERSLISTXML=groupmemberslist.xml\nGROUPPOOLSGETGROUPLISTXML=grouppoolsgetgrouplist.xml\n\n#interestingness\nINTERESTINGNESSXML=interestingness.xml\n\n#machinetags\nMACHINETAGSNAMESPACES=machinetagsnamespaces.xml\nMACHINETAGSGETPAIRS=machinetagsgetpairs.xml\nMACHINETAGSGETPREDICATES=machinetagsgetpredicates.xml\nMACHINETAGSGETRECENTVALUES=machinetagsgetrecentvalues.xml\nMACHINETAGSGETVALUES=machinetagsgetvalues.xml\n#echo \"API_KEY=${API_KEY}\"\n#echo \"API_SECRET=${API_SECRET}\"\n\n[ -d ${OUTPUTDIR} ]||{ echo \"No such dir,so mkdir ${OUTPUTDIR}\";mkdir ${OUTPUTDIR}; }\n\ngetInfo()\n{\n    echo \"*********************************************************\"\n    echo \"Get Info...\"\n    echo \"*********************************************************\"\n    METHORD=flickr.people.getInfo\n    OUTPUTFILE=${OUTPUTDIR}\/${INFOXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\ngetBloglist()\n{\n    echo \"*********************************************************\"\n    echo \"Get blog list...\"\n    echo \"*********************************************************\"\n    METHORD=flickr.blogs.getList\n    OUTPUTFILE=${OUTPUTDIR}\/${BLOGLISTXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat   ${OUTPUTFILE}\n}\n\npostPhoto()\n{\n    echo \"*********************************************************\"\n    echo \"Sent a post to blog...\"\n    echo \"*********************************************************\"\n    METHORD=flickr.blogs.postPhoto\n    OUTPUTFILE=${OUTPUTDIR}\/${POSTBLOGRESULTXML}\n    PHOTO_ID=3783563309\n    echo \"Please choose the blog you want to post a photo:\"\n    BLOGS=`cat ${OUTPUTDIR}\/${BLOGLISTXML}|grep id|cut -d \"=\" -f3|sed 's\/\"\/\/g'|sed 's\/service\/\/g'|grep -n \"\"`\n    echo \"${BLOGS}\"\n    read -p \"Enter your choice:\" CHOOSE\n    BLOGNAME=`echo \"${BLOGS}\"|grep \"^${CHOOSE}\"|cut -d \":\" -f2`\n    echo BLOGNAME=${BLOGNAME}\n    BLOG_ID=`grep ${BLOGNAME} ${OUTPUTDIR}\/${BLOGLISTXML}|cut -d \"\\\"\" -f2`\n\n    read -p \"Enter the password:\" PASSWORD\n    read -p \"Enter the Title:\" TITLE\n    read -p \"Enter the Description:\" DESCRIPTION\n    #PASSWORD=\n    echo PASSWORD=${PASSWORD}\n\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}blog_id${BLOG_ID}blog_password${PASSWORD}description${DESCRIPTION}method${METHORD}photo_id${PHOTO_ID}title${TITLE}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    PASSWORD=`echo ${PASSWORD}|sed 's\/\\#\/%23\/g'|sed 's\/@\/%40\/g'`\n    TITLE=`echo ${TITLE}|sed 's\/ \/+\/g'`\n    DESCRIPTION=`echo ${DESCRIPTION}|sed 's\/ \/+\/g'`\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&blog_id=${BLOG_ID}&photo_id=${PHOTO_ID}&title=${TITLE}&description=${DESCRIPTION}&blog_password=${PASSWORD}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\n\ngetServiceslist()\n{\n    echo \"*********************************************************\"\n    echo \"Get Services list...\"\n    echo \"*********************************************************\"\n    METHORD=flickr.blogs.getServices\n    OUTPUTFILE=${OUTPUTDIR}\/${SERVICESLISTXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\ngetToken()\n{\n    echo \"*********************************************************\"\n    echo \"Get frob...\"\n    echo \"*********************************************************\"\n    URL=http:\/\/flickr.com\/services\/rest\/?\n    OUTPUTFILE=${OUTPUTDIR}\/${FROBXML}\n    METHORD=flickr.auth.getFrob\n    SIG=${API_SECRET}api_key${API_KEY}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"${URL}method=${METHORD}&api_key=${API_KEY}&api_sig=${API_SIG}\"\n    echo FLICKR_URL=${FLICKR_URL}\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n\n    FROB=`cat ${OUTPUTFILE}|grep frob|cut -d \"&lt;\" -f2|cut -d \"&gt;\" -f2`\n    echo FROB=${FROB}\n\n    echo \"*********************************************************\"\n    echo \"Load firefox to Confirm the authentication.\"\n    echo \"*********************************************************\"\n    SIG=${API_SECRET}api_key${API_KEY}frob${FROB}permswrite\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/auth\/?api_key=${API_KEY}&perms=write&frob=${FROB}&api_sig=${API_SIG}\"\n    echo \"Loading ${FLICKR_URL}\"\n    firefox ${FLICKR_URL}\n    read -p \"Check OK[yes\/no]:\" CHOOSE\n    echo Your input:${CHOOSE}\n\n    METHORD=flickr.auth.getToken\n    OUTPUTFILE=${OUTPUTDIR}\/${TOKENXML}\n    SIG=${API_SECRET}api_key${API_KEY}frob${FROB}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=flickr.auth.getToken&api_key=${API_KEY}&frob=${FROB}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n    TOKEN=`cat ${OUTPUTFILE}|grep -i token|cut -d \"&gt;\" -f2|cut -d \"&lt;\" -f1`\n    #sed -i '\/^TOKEN\/d' ${CONFIGFILE}\n    #echo \"TOKEN=${TOKEN}\" &gt;&gt;${CONFIGFILE}\n    sed -i '\/^TOKEN\/s\/$\/'${TOKEN}'\/g' ${CONFIGFILE}\n    echo TOKEN=${TOKEN}\n}\n\ngetCommonsInstitutions()\n{\n    echo \"*********************************************************\"\n    echo \"Get flickr.commons.getInstitutions\"\n    echo \"*********************************************************\"\n\n    METHORD=flickr.commons.getInstitutions\n    OUTPUTFILE=${OUTPUTDIR}\/${COMMONSINSTITUTIONSXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\ngetContact()\n{\n    echo \"*********************************************************\"\n    echo \"Get contact list...\"\n    echo \"*********************************************************\"\n    METHORD=flickr.contacts.getList\n    OUTPUTFILE=${OUTPUTDIR}\/${CONTACTLIST}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n\n    echo \"*********************************************************\"\n    echo \"Get getListRecentlyUploaded\"\n    echo \"*********************************************************\"\n    METHORD=flickr.contacts.getListRecentlyUploaded\n    OUTPUTFILE=${OUTPUTDIR}\/${CONTACTLISTRECENTUPLOAD}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n\n\n    echo \"*********************************************************\"\n    echo \"Get flickr.contacts.getPublicList\"\n    echo \"*********************************************************\"\n    USER_ID=`grep nsid ${OUTPUTDIR}\/${TOKENXML}|cut -d \"\\\"\" -f2`\n    echo USER_ID=${USER_ID}\n    OUTPUTFILE=${OUTPUTDIR}\/${CONTACTLISTPUBLICLIST}\n    #USER_ID=40112025%40N03\n    METHORD=flickr.contacts.getPublicList\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}user_id${USER_ID}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    USER_ID=`echo ${USER_ID}|sed 's\/@\/%40\/g'`\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&user_id=${USER_ID}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\n\ngroupBrowser()\n{\n    echo \"*********************************************************\"\n    echo \"Group Browser\"\n    echo \"*********************************************************\"\n    METHORD=flickr.groups.browse\n    OUTPUTFILE=${OUTPUTDIR}\/${GROUPBROWSERXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\ngroupSearch()\n{\n    echo \"*********************************************************\"\n    echo \"Group Search \"\n    echo \"*********************************************************\"\n    METHORD=flickr.groups.search\n    OUTPUTFILE=${OUTPUTDIR}\/${GROUPSEARCHXML}\n    read -p \"Input a group to search:\" TEXT\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}text${TEXT}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&text=${TEXT}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\ngetGroupInfo()\n{\n    echo \"*********************************************************\"\n    echo \"Get Group Info\"\n    echo \"*********************************************************\"\n    METHORD=flickr.groups.getInfo\n    OUTPUTFILE=${OUTPUTDIR}\/${GROUPINFOXML}\n    read -p \"Input the group Id:\" GROUP_ID\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}group_id${GROUP_ID}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    GROUP_ID=`echo ${GROUP_ID}|sed 's\/@\/%40\/g'`\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}group_id${GROUP_ID}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&group_id=${GROUP_ID}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\ngetGroupList()\n{\n    #The directory is newer than the file.\n    if [ ${OUTPUTDIR}  -nt  ${OUTPUTDIR}\/${GROUPPOOLSGETGROUPLISTXML} ];then\n\tgetPoolsGroupList\n    fi\n    #    cat ${GROUPPOOLSGETGROUPLISTXML}|grep nsid|awk -F \"\\\"\" '{print $2 \":\" $6}'|grep -n \"\"\n}\n\ngetGroupMembersList()\n{\n    echo \"*********************************************************\"\n    echo \"Get Group members list\"\n    echo \"*********************************************************\"\n    METHORD=flickr.groups.members.getList\n    OUTPUTFILE=${OUTPUTDIR}\/${GROUPMEMBERSLISTXML}\n    echo \"Here you can enter a group id.\"\n    echo \"if input nothing,you will choose the group your have joined(Suggest)\"\n    read -p \"Input the group Id:\" GROUP_ID\n    if [ -z \"${GROUP_ID}\" ];then\n\tgetGroupList\n\tGROUPLIST=`cat ${OUTPUTDIR}\/${GROUPPOOLSGETGROUPLISTXML}|grep nsid|awk -F \"\\\"\" '{print $2 \":\" $6}'|grep -n \"\"`\n\techo \"${GROUPLIST}\"\n\tread -p \"Input your choise:\" GROUP_ID\n\tGROUP_ID=`echo \"${GROUPLIST}\"|grep \"^${GROUP_ID}\"|cut -d \":\" -f2`\n    fi\n\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}group_id${GROUP_ID}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    GROUP_ID=`echo ${GROUP_ID}|sed 's\/@\/%40\/g'`\n    FLICKR_URL=\"http:\/\/flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}group_id${GROUP_ID}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&group_id=${GROUP_ID}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\n\ngetPoolsGroupList()\n{\n    echo \"*********************************************************\"\n    echo \"Get Group Pools List\"\n    echo \"*********************************************************\"\n    METHORD=flickr.groups.pools.getGroups\n    OUTPUTFILE=${OUTPUTDIR}\/${GROUPPOOLSGETGROUPLISTXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\ngroupMenu()\n{\n    echo \"*******Group Operations Menu(Flickr.com)**************************************\"\n    echo \"Please select:\"\n    echo \"1.Group Browser\"\n    echo \"2.Group Search\"\n    echo \"3.Get Group Info\"\n    echo \"4.Get GroupMembersList\"\n    echo \"5.Get Group Pools List\"\n    echo \"q.Back to the pre Menu\"\n}\n\ngroup()\n{\n    echo \"*********************************************************\"\n    echo \"About Group Operation\"\n    echo \"*********************************************************\"\n\n    groupMenu\n    read -p \"Please Select:\" CHOOSE\n    while [ ${CHOOSE} != \"q\"  ];do\n\tcase ${CHOOSE} in\n\t    \"1\"  ) groupBrowser;;\n\t    \"2\"  ) groupSearch;;\n\t    \"3\"  ) getGroupInfo;;\n\t    \"4\"  ) getGroupMembersList;;\n\t    \"5\"  ) getPoolsGroupList;;\n\t    \"q\"  ) exit 0;;\n\n\t    \"*\"  ) echo \"Wrong Selection\";;\n\tesac\n\n\tgroupMenu\n\tread -p \"Please Select:\" CHOOSE\n\tclear\n    done\n\n}\n\n\ngetInterestingnessList()\n{\n    echo \"*********************************************************\"\n    echo \"Get Interestingness List\"\n    echo \"*********************************************************\"\n    METHORD=flick.interestingness.getList\n    OUTPUTFILE=${OUTPUTDIR}\/${INTERESTINGNESSXML}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\nmachinetagsGetNamespaces()\n{\n    echo \"*********************************************************\"\n    echo \"machinetags.getNamespaces\"\n    echo \"*********************************************************\"\n    METHORD=flickr.machinetags.getNamespaces\n    OUTPUTFILE=${OUTPUTDIR}\/${MACHINETAGSNAMESPACES}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\nmachinetagsGetPairs()\n{\n    echo \"*********************************************************\"\n    echo \"machinetags.getPairs\"\n    echo \"*********************************************************\"\n    METHORD=flickr.machinetags.getPairs\n    OUTPUTFILE=${OUTPUTDIR}\/${MACHINETAGSGETPAIRS}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\nmachinetagsGetPredicates()\n{\n    echo \"*********************************************************\"\n    echo \"machinetags.getPredicates\"\n    echo \"*********************************************************\"\n    METHORD=flickr.machinetags.getPredicates\n    OUTPUTFILE=${OUTPUTDIR}\/${MACHINETAGSGETPREDICATES}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\nmachinetagsGetRecentValues()\n{\n    echo \"*********************************************************\"\n    echo \"machinetags.getGetRecentValues\"\n    echo \"*********************************************************\"\n    METHORD=flickr.machinetags.getRecentValues\n    OUTPUTFILE=${OUTPUTDIR}\/${MACHINETAGSGETRECENTVALUES}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\nmachinetagsGetValues()\n{\n    echo \"*********************************************************\"\n    echo \"machinetags.getValues\"\n    echo \"I will just exit this function,because here we need two  argus:namespace,predicate\"\n    echo \"Now I don't know what is the meaning of namespace and predicate\"\n    echo \"*********************************************************\"\n    exit 0\n\n    METHORD=flickr.machinetags.getValues\n    OUTPUTFILE=${OUTPUTDIR}\/${MACHINETAGSGETVALUES}\n    SIG=${API_SECRET}api_key${API_KEY}auth_token${TOKEN}method${METHORD}\n    echo SIG=${SIG}\n    API_SIG=`java md5 ${SIG}`\n    echo API_SIG=${API_SIG}\n    FLICKR_URL=\"http:\/\/api.flickr.com\/services\/rest\/?method=${METHORD}&api_key=${API_KEY}&auth_token=${TOKEN}&api_sig=${API_SIG}\"\n\n    wget  ${FLICKR_URL} -O ${OUTPUTFILE}\n    cat ${OUTPUTFILE}\n}\n\n\nmachinetagsMenu()\n{\n    echo \"*******mechinetags Menu(impjq.net)**************************************\"\n    echo \"Please select:\"\n    echo \"1.machinetagsGetNamespaces\"\n    echo \"2.machinetagsGetPairs\"\n    echo \"3.machinetagsGetPredicates\"\n    echo \"4.machinetagsGetRecentValues\"\n    echo \"5.machinetagsGetValues\"\n    echo \"q.Back to the pre Menu\"\n}\n\nmachinetags()\n{\n    machinetagsMenu\n    echo \"*********************************************************\"\n    echo \"About machinetags Operation\"\n    echo \"*********************************************************\"\n\n    read -p \"Please Select:\" CHOOSE\n    while [ ${CHOOSE} != \"q\"  ];do\n\tcase ${CHOOSE} in\n\t    \"1\"  ) machinetagsGetNamespaces;;\n\t    \"2\"  ) machinetagsGetPairs;;\n\t    \"3\"  ) machinetagsGetPredicates;;\n\t    \"4\"  ) machinetagsGetRecentValues;;\n\t    \"5\"  ) machinetagsGetValues;;\n\t    \"q\"  ) exit 0;;\n\n\t    \"*\"  ) echo \"Wrong Selection\";;\n\tesac\n\n\tmachinetagsMenu\n\tread -p \"Please Select:\" CHOOSE\n\tclear\n    done\n\n}\n\n\ncheckConfigfile()\n{\n    if [ -e ${CONFIGFILE} ];then\n\techo \"*******************************************************************\"\n\techo \"Your config file:${CONFIGFILE} already exists.\"\n\techo \"*******************************************************************\"\n\techo \"Now check the API_KEY and API_SECRET\"\n\techo \"*******************************************************************\"\n\tAPI_KEY=`grep -v \"#\" ${CONFIGFILE}|grep API_KEY |cut -d \"=\" -f2`\n\tAPI_SECRET=`grep -v \"#\" ${CONFIGFILE}|grep API_SECRET|cut -d \"=\" -f2`\n\tOUTPUTDIR=`grep -v \"#\" ${CONFIGFILE}|grep OUTPUTDIR|cut -d \"=\" -f2`\n\tif [ -z ${API_KEY} ] || [  -z ${API_SECRET}  ] || [ -z ${OUTPUTDIR} ] ;then\n\t    echo \"Your config file seems having some problem,Please check it.\"\n\t    echo \"*******************************************************************\"\n\t    exit 0\n\tfi\n\n\n    else\n\techo \"*******************************************************************\"\n\techo \"Your config file:${CONFIGFILE} doesn't exist,Now create the file.\"\n\ttouch ${CONFIGFILE}\n\techo \"API_KEY=\" &gt;&gt;${CONFIGFILE}\n\techo \"API_SECRET=\" &gt;&gt;${CONFIGFILE}\n\techo \"OUTPUTDIR=.\/xml\"&gt;&gt;${CONFIGFILE}\n\techo \"TOKEN=\"&gt;&gt;${CONFIGFILE}\n\techo \"*******************************************************************\"\n\techo \"Create successfully,Now Please edit your config file,then restart this shell \"\n\techo \"*******************************************************************\"\n\texit 0\n\n    fi\n}\n\nmyhelp()\n{\n    echo \"This shell is used to test the Flickr API,for more information,Please visit my site:www.impjq.net\"\n\n}\n\nmainMenu()\n{\n    echo \"*******Main Menu(impjq.net)**************************************\"\n    echo \"Please select your action:\"\n    echo \"1.Get Info\"\n    echo \"2.Get blog list\"\n    echo \"3.Get services list\"\n    echo \"4.Post a photo to your blog\"\n    echo \"5.Get Commons Institutions\"\n    echo \"6.Get Contact list(including recently upload and public list)\"\n    echo \"7.Group Operations\"\n    echo \"              =&gt;&gt;Have sub menu\"\n    echo \"8.Get interestingness list\"\n    echo \"9.machinetags operation\"\n    echo \"              =&gt;&gt;Have sub menu\"\n\n    echo \"h.Enter this for help information\"\n    echo \"q.Enter this to exit\"\n    echo \"*******************************************************************\"\n}\n\n\necho \"*******************************************************************\"\necho \"Here is the main function. \"\necho \"*******************************************************************\"\necho \"First check your config file \"\ncheckConfigfile\necho \"Your config file is correct,Now get the auth token...\"\necho \"If does't exist in the config file,it will re-get the token from flickr.com ...\"\necho \"*******************************************************************\"\n#TOKEN=`grep -v \"#\" ${CONFIGFILE}|grep \"TOKEN\"|cut -d \"=\" f2`\nTOKEN=`grep -v \"#\" ${CONFIGFILE}|grep \"TOKEN\"|cut -d \"=\" -f2`\necho TOKEN=${TOKEN}\n\nif [ -z \"${TOKEN}\" ];then\n    getToken\nfi\n\necho \"*******************************************************************\"\necho \"Now you can use this token to Communication with flickr.com\"\necho \"Here you can select what you want to do in this simple menu.\"\necho \"*******************************************************************\"\nmainMenu\nread -p \"Please Select:\" CHOOSE\n\nwhile [ \"${CHOOSE}\" != \"q\" ];do\n    case \"${CHOOSE}\" in\n\t\"1\" ) getInfo;;\n\t\"2\" ) getBloglist;;\n\t\"3\" ) getServiceslist;;\n\t\"4\" ) postPhoto;;\n\t\"5\" ) getCommonsInstitutions;;\n\t\"6\" ) getContact;;\n\t\"7\" ) group;;\n\t\"8\" ) getInterestingnessList;;\n\t\"9\" ) machinetags;;\n\n\t\"h\" ) myhelp;;\n\t\"q\" ) exit 0;;\n\n\t*   ) echo \"Wrong selection\";;\n    esac\n    mainMenu\n    read -p \"Please Select:\" CHOOSE\n    clear\n\ndone\n\n\n\n<\/pre>\n<p>\u64cd\u4f5c\u6f14\u793a\uff1a<\/p>\n<pre lang=\"java\" line=\"1\">\npjq@gentoo-pjq ~\/flickr $ .\/flickr.sh\nconfig file=flickr.conf\n*******************************************************************\nHere is the main function.\n*******************************************************************\nFirst check your config file\n*******************************************************************\nYour config file:flickr.conf already exists.\n*******************************************************************\nNow check the API_KEY and API_SECRET\n*******************************************************************\nYour config file is correct,Now get the auth token...\nIf does't exist in the config file,it will re-get the token from flickr.com ...\n*******************************************************************\nTOKEN=72157621931805794-b803928ff2524a5b\n*******************************************************************\nNow you can use this token to Communication with flickr.com\nHere you can select what you want to do in this simple menu.\n*******************************************************************\n*******Main Menu(impjq.net)**************************************\nPlease select your action:\n1.Get Info\n2.Get blog list\n3.Get services list\n4.Post a photo to your blog\n5.Get Commons Institutions\n6.Get Contact list(including recently upload and public list)\n7.Group Operations\n              =&gt;&gt;Have sub menu\n8.Get interestingness list\n9.machinetags operation\n              =&gt;&gt;Have sub menu\nh.Enter this for help information\nq.Enter this to exit\n*******************************************************************\nPlease Select:9\n*******mechinetags Menu(impjq.net)**************************************\nPlease select:\n1.machinetagsGetNamespaces\n2.machinetagsGetPairs\n3.machinetagsGetPredicates\n4.machinetagsGetRecentValues\n5.machinetagsGetValues\nq.Back to the pre Menu\n*********************************************************\nAbout machinetags Operation\n*********************************************************\nPlease Select:q\n*******Main Menu(impjq.net)**************************************\nPlease select your action:\n1.Get Info\n2.Get blog list\n3.Get services list\n4.Post a photo to your blog\n5.Get Commons Institutions\n6.Get Contact list(including recently upload and public list)\n7.Group Operations\n              =&gt;&gt;Have sub menu\n8.Get interestingness list\n9.machinetags operation\n              =&gt;&gt;Have sub menu\nh.Enter this for help information\nq.Enter this to exit\n*******************************************************************\nPlease Select:7\n\n*********************************************************\nAbout Group Operation\n*********************************************************\n*******Group Operations Menu(Flickr.com)**************************************\nPlease select:\n1.Group Browser\n2.Group Search\n3.Get Group Info\n4.Get GroupMembersList\n5.Get Group Pools List\nq.Back to the pre Menu\nPlease Select:q\n*******Main Menu(impjq.net)**************************************\nPlease select your action:\n1.Get Info\n2.Get blog list\n3.Get services list\n4.Post a photo to your blog\n5.Get Commons Institutions\n6.Get Contact list(including recently upload and public list)\n7.Group Operations\n              =&gt;&gt;Have sub menu\n8.Get interestingness list\n9.machinetags operation\n              =&gt;&gt;Have sub menu\nh.Enter this for help information\nq.Enter this to exit\n*******************************************************************\nPlease Select:\n\n\n<\/pre>\n<div class=\"zemanta-pixie\"><img decoding=\"async\" class=\"zemanta-pixie-img\" alt=\"\" src=\"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84\" \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06\u811a\u672c\u6574\u5408\u4e86\u4e00\u4e0b\uff0c\u66f4\u591a\u6d4b\u8bd5\u529f\u80fd\u8fd8\u5728\u8fdb\u4e00\u6b65\u5b8c\u5584\u4e2d\u3002 \u4e0b\u8f7d\u6e90\u7801\uff1ahttp:\/\/github.com\/pjq\/FlickrShell\/tree\/master 1.\u65b0\u589e\u4e86\u914d\u7f6e\u6587\u4ef6:flickr.conf,\u5c06\u4f60\u7684API_KEY\u53ca\u5bc6\u94a5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u597d\uff0c\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u8fd0\u884c\uff0c\u4f1a\u81ea\u52a8 \u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u8fdb\u884c\u76f8\u5e94\u7f16\u8f91\u5c31\u884c\u4e86\u3002 \u65b0\u521b\u5efa\u7684\u6587\u4ef6\u5f62\u5f0f\u5982\u4e0b\uff1a pjq@gentoo-pjq ~\/flickr $ cat flickr.conf API_KEY= API_SECRET= OUTPUTDIR=.\/xml TOKEN= 2.\u5c06\u4e0b\u8f7d\u7684\u4e34\u65f6\u6587\u4ef6\u9ed8\u8ba4\u653e\u5728\u5f53\u524d\u76ee\u5f55\u4e0b(.\/xml)\uff0c\u8fd9\u4e2a\u8def\u5f84\u4f60\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u4fee\u6539 3.\u83dc\u5355\u7528\u7684\u662fwhile\u8bed\u53e5\uff0c\u53ea\u8981\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u201cq\u201d\u5c31\u4f1a\u4e00\u76f4\u5faa\u73af;\u5e76\u4e14\u5305\u542b\u6709\u5b50\u83dc\u5355\uff0c\u5728\u5b50\u83dc\u5355\u4e2d\u8f93\u5165 &#8220;q&#8221;\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u4e0a\u4e00\u7ea7\u83dc\u5355\uff08\u73b0\u5728\u8fd8\u4e0d\u80fd\u786e\u8ba4\uff0c\u53ea\u662f\u73b0\u5728\u770b\u5230\u7684\u5c31\u662f\u8fd9\u79cd\u6548\u679c\uff0c\u5f53\u7136\u6211\u8fd9\u91cc\u53ea\u67092\u7ea7 \u83dc\u5355\uff09 4.\u66f4\u591aAPI\u529f\u80fd\u518d\u6162\u6162\u5b8c\u5584\uff0c\u8981\u67e5\u770b\u73b0\u6709\u54ea\u4e9b\u529f\u80fd\uff0c\u53ea\u8981\u542f\u52a8\u7a0b\u5e8f\u8fdb\u5165\u5230\u4e3b\u83dc\u5355\u4e2d\u5c31\u4f1a\u5217\u51fa\u6765\u4e86\u3002 *******Main Menu(Flickr.com)************************************** Please select your action: 1.Get Info 2.Get blog list 3.Get services list 4.Post a photo to your blog 5.Get<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,28,6],"tags":[],"class_list":["post-642","post","type-post","status-publish","format-standard","hentry","category-bash","category-flickr","category-shell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09 - Jianqing&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pjq.me\/?p=642\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09 - Jianqing&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u5c06\u811a\u672c\u6574\u5408\u4e86\u4e00\u4e0b\uff0c\u66f4\u591a\u6d4b\u8bd5\u529f\u80fd\u8fd8\u5728\u8fdb\u4e00\u6b65\u5b8c\u5584\u4e2d\u3002 \u4e0b\u8f7d\u6e90\u7801\uff1ahttp:\/\/github.com\/pjq\/FlickrShell\/tree\/master 1.\u65b0\u589e\u4e86\u914d\u7f6e\u6587\u4ef6:flickr.conf,\u5c06\u4f60\u7684API_KEY\u53ca\u5bc6\u94a5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u597d\uff0c\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u8fd0\u884c\uff0c\u4f1a\u81ea\u52a8 \u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u8fdb\u884c\u76f8\u5e94\u7f16\u8f91\u5c31\u884c\u4e86\u3002 \u65b0\u521b\u5efa\u7684\u6587\u4ef6\u5f62\u5f0f\u5982\u4e0b\uff1a pjq@gentoo-pjq ~\/flickr $ cat flickr.conf API_KEY= API_SECRET= OUTPUTDIR=.\/xml TOKEN= 2.\u5c06\u4e0b\u8f7d\u7684\u4e34\u65f6\u6587\u4ef6\u9ed8\u8ba4\u653e\u5728\u5f53\u524d\u76ee\u5f55\u4e0b(.\/xml)\uff0c\u8fd9\u4e2a\u8def\u5f84\u4f60\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u4fee\u6539 3.\u83dc\u5355\u7528\u7684\u662fwhile\u8bed\u53e5\uff0c\u53ea\u8981\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u201cq\u201d\u5c31\u4f1a\u4e00\u76f4\u5faa\u73af;\u5e76\u4e14\u5305\u542b\u6709\u5b50\u83dc\u5355\uff0c\u5728\u5b50\u83dc\u5355\u4e2d\u8f93\u5165 &#8220;q&#8221;\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u4e0a\u4e00\u7ea7\u83dc\u5355\uff08\u73b0\u5728\u8fd8\u4e0d\u80fd\u786e\u8ba4\uff0c\u53ea\u662f\u73b0\u5728\u770b\u5230\u7684\u5c31\u662f\u8fd9\u79cd\u6548\u679c\uff0c\u5f53\u7136\u6211\u8fd9\u91cc\u53ea\u67092\u7ea7 \u83dc\u5355\uff09 4.\u66f4\u591aAPI\u529f\u80fd\u518d\u6162\u6162\u5b8c\u5584\uff0c\u8981\u67e5\u770b\u73b0\u6709\u54ea\u4e9b\u529f\u80fd\uff0c\u53ea\u8981\u542f\u52a8\u7a0b\u5e8f\u8fdb\u5165\u5230\u4e3b\u83dc\u5355\u4e2d\u5c31\u4f1a\u5217\u51fa\u6765\u4e86\u3002 *******Main Menu(Flickr.com)************************************** Please select your action: 1.Get Info 2.Get blog list 3.Get services list 4.Post a photo to your blog 5.Get\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pjq.me\/?p=642\" \/>\n<meta property=\"og:site_name\" content=\"Jianqing&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2009-08-04T14:47:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84\" \/>\n<meta name=\"author\" content=\"pengjianqing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pengjianqing\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/pjq.me\/?p=642#article\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/?p=642\"},\"author\":{\"name\":\"pengjianqing\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"headline\":\"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09\",\"datePublished\":\"2009-08-04T14:47:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/pjq.me\/?p=642\"},\"wordCount\":18,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"image\":{\"@id\":\"https:\/\/pjq.me\/?p=642#primaryimage\"},\"thumbnailUrl\":\"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84\",\"articleSection\":[\"BASH\",\"flickr\",\"shell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/pjq.me\/?p=642#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/pjq.me\/?p=642\",\"url\":\"https:\/\/pjq.me\/?p=642\",\"name\":\"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09 - Jianqing&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/pjq.me\/?p=642#primaryimage\"},\"image\":{\"@id\":\"https:\/\/pjq.me\/?p=642#primaryimage\"},\"thumbnailUrl\":\"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84\",\"datePublished\":\"2009-08-04T14:47:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/pjq.me\/?p=642#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/pjq.me\/?p=642\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pjq.me\/?p=642#primaryimage\",\"url\":\"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84\",\"contentUrl\":\"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/pjq.me\/?p=642#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/pjq.me\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/pjq.me\/#website\",\"url\":\"https:\/\/pjq.me\/\",\"name\":\"Jianqing&#039;s Blog\",\"description\":\"Thoughts and Future\",\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/pjq.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\",\"name\":\"pengjianqing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"contentUrl\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"width\":460,\"height\":752,\"caption\":\"pengjianqing\"},\"logo\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/pjq.me\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09 - Jianqing&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pjq.me\/?p=642","og_locale":"en_US","og_type":"article","og_title":"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09 - Jianqing&#039;s Blog","og_description":"\u5c06\u811a\u672c\u6574\u5408\u4e86\u4e00\u4e0b\uff0c\u66f4\u591a\u6d4b\u8bd5\u529f\u80fd\u8fd8\u5728\u8fdb\u4e00\u6b65\u5b8c\u5584\u4e2d\u3002 \u4e0b\u8f7d\u6e90\u7801\uff1ahttp:\/\/github.com\/pjq\/FlickrShell\/tree\/master 1.\u65b0\u589e\u4e86\u914d\u7f6e\u6587\u4ef6:flickr.conf,\u5c06\u4f60\u7684API_KEY\u53ca\u5bc6\u94a5\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u597d\uff0c\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u8fd0\u884c\uff0c\u4f1a\u81ea\u52a8 \u521b\u5efa\u8fd9\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u8fdb\u884c\u76f8\u5e94\u7f16\u8f91\u5c31\u884c\u4e86\u3002 \u65b0\u521b\u5efa\u7684\u6587\u4ef6\u5f62\u5f0f\u5982\u4e0b\uff1a pjq@gentoo-pjq ~\/flickr $ cat flickr.conf API_KEY= API_SECRET= OUTPUTDIR=.\/xml TOKEN= 2.\u5c06\u4e0b\u8f7d\u7684\u4e34\u65f6\u6587\u4ef6\u9ed8\u8ba4\u653e\u5728\u5f53\u524d\u76ee\u5f55\u4e0b(.\/xml)\uff0c\u8fd9\u4e2a\u8def\u5f84\u4f60\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u4fee\u6539 3.\u83dc\u5355\u7528\u7684\u662fwhile\u8bed\u53e5\uff0c\u53ea\u8981\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u201cq\u201d\u5c31\u4f1a\u4e00\u76f4\u5faa\u73af;\u5e76\u4e14\u5305\u542b\u6709\u5b50\u83dc\u5355\uff0c\u5728\u5b50\u83dc\u5355\u4e2d\u8f93\u5165 &#8220;q&#8221;\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u4e0a\u4e00\u7ea7\u83dc\u5355\uff08\u73b0\u5728\u8fd8\u4e0d\u80fd\u786e\u8ba4\uff0c\u53ea\u662f\u73b0\u5728\u770b\u5230\u7684\u5c31\u662f\u8fd9\u79cd\u6548\u679c\uff0c\u5f53\u7136\u6211\u8fd9\u91cc\u53ea\u67092\u7ea7 \u83dc\u5355\uff09 4.\u66f4\u591aAPI\u529f\u80fd\u518d\u6162\u6162\u5b8c\u5584\uff0c\u8981\u67e5\u770b\u73b0\u6709\u54ea\u4e9b\u529f\u80fd\uff0c\u53ea\u8981\u542f\u52a8\u7a0b\u5e8f\u8fdb\u5165\u5230\u4e3b\u83dc\u5355\u4e2d\u5c31\u4f1a\u5217\u51fa\u6765\u4e86\u3002 *******Main Menu(Flickr.com)************************************** Please select your action: 1.Get Info 2.Get blog list 3.Get services list 4.Post a photo to your blog 5.Get","og_url":"https:\/\/pjq.me\/?p=642","og_site_name":"Jianqing&#039;s Blog","article_published_time":"2009-08-04T14:47:40+00:00","og_image":[{"url":"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84","type":"","width":"","height":""}],"author":"pengjianqing","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pengjianqing","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pjq.me\/?p=642#article","isPartOf":{"@id":"https:\/\/pjq.me\/?p=642"},"author":{"name":"pengjianqing","@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"headline":"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09","datePublished":"2009-08-04T14:47:40+00:00","mainEntityOfPage":{"@id":"https:\/\/pjq.me\/?p=642"},"wordCount":18,"commentCount":0,"publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"image":{"@id":"https:\/\/pjq.me\/?p=642#primaryimage"},"thumbnailUrl":"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84","articleSection":["BASH","flickr","shell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pjq.me\/?p=642#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pjq.me\/?p=642","url":"https:\/\/pjq.me\/?p=642","name":"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09 - Jianqing&#039;s Blog","isPartOf":{"@id":"https:\/\/pjq.me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/pjq.me\/?p=642#primaryimage"},"image":{"@id":"https:\/\/pjq.me\/?p=642#primaryimage"},"thumbnailUrl":"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84","datePublished":"2009-08-04T14:47:40+00:00","breadcrumb":{"@id":"https:\/\/pjq.me\/?p=642#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pjq.me\/?p=642"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pjq.me\/?p=642#primaryimage","url":"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84","contentUrl":"http:\/\/img.zemanta.com\/pixy.gif?x-id=4f72711b-8728-860f-a33b-7015062c6a84"},{"@type":"BreadcrumbList","@id":"https:\/\/pjq.me\/?p=642#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pjq.me\/"},{"@type":"ListItem","position":2,"name":"Flickr API \u6d4b\u8bd5\u811a\u672c\uff08\u5b8c\u6574\u7248\uff09"}]},{"@type":"WebSite","@id":"https:\/\/pjq.me\/#website","url":"https:\/\/pjq.me\/","name":"Jianqing&#039;s Blog","description":"Thoughts and Future","publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pjq.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60","name":"pengjianqing","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/","url":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","contentUrl":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","width":460,"height":752,"caption":"pengjianqing"},"logo":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/"},"url":"https:\/\/pjq.me\/?author=1"}]}},"views":2883,"_links":{"self":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=642"}],"version-history":[{"count":0,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/642\/revisions"}],"wp:attachment":[{"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}