Автоматическая публикация на блогах...

?????? ???? ?? ??????... (??, ??, ?????-???? ? ?????????????...) ????? ??????-?????? ???????? Blogger Api, ? ???? ????? ???????????, ???????? ?????, ? ??? ? ?? ???? ?????????, ???? ?? ??? ???????? ???? ?????, ????????? description ???????? ? ?????????. ? ??? ??? ? ???????????? ?????, ??? ?????????, ??????, ?????? ???? ? <title>-</title>, ? ????????? ????? ???????????????? ?????? ???????? ?????? ?????, ?? ????? ??? ?????? ? ????????? ?? ???????? ????? ???????????. ??? ?????, ??? ???? ? ??? ??????? ???? ?????? ? ??????? ???? API ?????????? -- ??? ?????? ?????????? ????? Data API.

? ??? ?? ????, ?????? ? ?????? ????? ????, ???????? ??????????? ???-???? ????????? ????? ?????????????, ? ???????? ???-???? ???????????. ?? ? Blogger API, ? ? ??? ??????????? Weblog API. ???????? ????? ?????? ?? ????????? (??? ???????? ? ???????????), ????????? ??? ????????????? ????? ?????????? ???? ??? ???????, ?? ??????? ????? ?? ?????????. ????????????:

  1. ?????? ??????? (??. ????) ?????? ???????????
  2. ???? ????? ?????????? ? base64, ???? ??????? ???????????? ???? ????? ????
  3. ???? ? ????????, ?? ????? ????????? ??????? Content-Type: text/xml
  4. ?????? ?????? ?????? ?? ? ???? ???????-???????? ???? ? ??? ??, ? ?????? ??? ????? ?????? ?? ????????????.
  5. ???? ???? ?? ? ???? ???????? ???????????? - ????? ???????? ?????????? ?????? ?? ????? ????? ??????.

 ??, ? ?????????? ???:

import httplib
import base64

def publishPost(title, time, descr):
                descr = base64.b64encode(descr)
                body1 = """
                <?xml version="1.0"?>
                <methodCall>
                 <methodName>metaWeblog.newPost</methodName>
                 <params>
                 <param><value><string>BlogId</string></value></param>
                 <param><value><string>YourUserId</string></value></param>
                 <param><value><string>YourPassword</string></value></param>
                 <param><value><struct>
                 <member><name>title</name><value>"""
                body2 = """</value></member>
                 <member><name>description</name><value><base64>"""
                body3 = """</base64></value></member>
                 <member><name>pubDate</name><value>"""
                body4 = """</value></member>
                 </struct></value></param>
                 <param><value><boolean>true</boolean></value></param>
                 </params>
                </methodCall>
                """
                body = body1 + title + body2 + descr + body3 + time + body4
                print body

                conn = httplib.HTTPConnection("www.YourSite.com")
                headers = {"Content-Type": "text/xml"}
                conn.request("POST", "/path-to-xml-rpc-end-point/xmlrpc.php", body, headers)
                res = conn.getresponse()

                # Just to see what's the result
                print "Status: " + str(res.status)
                print "Headers: "
                print res.getheaders()
                print "Body: "
                print res.read()
                conn.close()

publishPost("My test tile", "date-time-in-right-format", "My test body")

???? ???? ??????, ?????? ???? ?????? ??????.