SHARE
TWEET

tcl xml-rpc post over http

a guest Apr 7th, 2010 2,404 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set getchal "<?xml version=\"1.0\"?>
  2. <methodCall>
  3. <methodName>LJ.XMLRPC.getchallenge</methodName>
  4. <params>
  5. <param>
  6. <value><struct>
  7. <member><name>username</name><value><string>$::ljname</string></value></member>
  8. <member><name>password</name><value><string>$::ljpswd</string></value></member>
  9. </struct></value>
  10. </param>
  11. </params>
  12. </methodCall>"
  13.  
  14. set getchallenge [http::geturl http://www.livejournal.com/interface/xmlrpc -query $getchal -type "text/xml" ]
  15. set mychal [http::meta $getchallenge]  # also tried with http::status, no joy either way
  16. set doc [dom parse $mychal]
  17. set root [$mychal documentElement]
  18. set nodeList [$root selectNodes {descendant::a}]
  19. set chalvar {}
  20.  
  21. foreach node $nodeList {
  22.         set attList [$node attributes *]
  23.         foreach attribute $attList {
  24.             if {[string tolower $attribute] == "c0:"} {
  25.                 set mychal [$node getAttribute $attribute]
  26.                 break
  27.             }
  28.         }
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top