Personal Blog
Personal Blog
понедельник, 3 сентября 2012 г.
вторник, 15 ноября 2011 г.
Clare Maguire -The Last Dance (Chase & Status Remix Video) 2011
Clare Maguire -The Last Dance (Chase & Status Remix Video) 2011
Today I feel the mood
And I don't feel like talking oh ho a waha
I wasn't ready to lose you
You're the first man to move me yeah
You help me feel alive
Got me up from 9 til 5 oh ho a waha
I could get through those days
With you on my mind yeah
Gotta try and move on
But I promise you
I will kiss your crown when life takes me down
I saved my last dance for you
My friend
I saved my last dance for you
My friend
And all the seats in the crowd
Oh people love to move now oh ho a waha
I just can't feel the beat
Cos my heart's fallen out yeah
Gotta try and move on
But I promise you
I will kiss your crown when life takes me dow
Today I feel the mood
And I don't feel like talking oh ho a waha
I wasn't ready to lose you
You're the first man to move me yeah
You help me feel alive
Got me up from 9 til 5 oh ho a waha
I could get through those days
With you on my mind yeah
Gotta try and move on
But I promise you
I will kiss your crown when life takes me down
I saved my last dance for you
My friend
I saved my last dance for you
My friend
And all the seats in the crowd
Oh people love to move now oh ho a waha
I just can't feel the beat
Cos my heart's fallen out yeah
Gotta try and move on
But I promise you
I will kiss your crown when life takes me dow
Ярлыки:
Chase Status,
Clare Maguire,
The Last Dance
пятница, 14 октября 2011 г.
среда, 12 октября 2011 г.
Talisman Mix - in the RAIN
Tracklist:
1.Ruslan_set_ft_V_Ray_the_Voice_of_Star_SoulSun_Remix
2.Betsie_Larkin_You_Belong_To_Me_El_gambrero_remix
3.Parfenov_Anton_Balkov_Day_by_day_El_Gambrero_remix
4.Vitaly_Beskrovny_Past_Postcards_I
5.Harland_-_Here_In_The_Dark_Acoustic_Mix
6.Chris Wonderful & Kate Walsh – ID
7.CJ_Boleg_-_Love_will_find_a_way_cjclub_ru
8.Gabriel_Dresden_Tracking_Treasure_Down_Lightone_chill_remix
9. Naksi & Brunner - Balaton (feat Myrtill - Brunner's Sunset mix
10.t.i.ft._christina_aguilera_-_castle_walls_fauxs_dubstep_remix
вторник, 11 октября 2011 г.
Wordpress Delphi Unit using XML-RPC
Hello, I tried to create a wordpress unit for Delphi.
This because I did not find any others libraries wich work with wordpress xml-rpc.
unit WPUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls,
XMLIntf, XMLDom, XMLDoc;
type
TSimpleType = (tsInt, tsI4, tsString, tsDouble, tsDateTime, tsBase64, tsBoolean, tsArray);
type
PXMLDocument = ^IXMLDocument;
type
TStructElement = packed record
Name : string; // element name
SType: TSimpleType; // element type
Value: string; // will contain value of element
ValueList: TStrings; // Used only in case of tsArray type
end;
type TStructArray = Array of TStructElement;
type
TWP = class(TForm)
IdHTTP: TIdHTTP;
IdAntiFreeze: TIdAntiFreeze;
lbStatus: TLabel;
Label1: TLabel;
procedure IdHTTPStatus(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: String);
private
{ Private declarations }
function GetDocument(methodName: string): IXMLDocument;
procedure SetXMLParam(SimpleType: TSimpleType; Value: string; Document: PXMLDocument);
procedure SetXMLStructure(Struct: TStructArray; Document: PXMLDocument);
function SendQuery(Document: IXMLDocument; BlogURL: string): IXMLDocument;
function ParseErrors(Document: PXMLDocument): TStringList;
function GetTypeResult(ElementType: String; Document: PXMLDocument): String;
public
{ Public declarations }
function sayHello(BlogURL: string): string;
function listMethods(BlogURL: string): string;
function newPost(BlogURL: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
function editPost(BlogURL: string;
post_id: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
function getPost(BlogURL: string;
username: string;
password: string;
post_id: string): IXMLDocument;
function getRecentPosts(BlogURL: string;
username: string;
password: string;
count: string): IXMLDocument;
function getPostsArrayField(Field: string; ResponseDoc: IXMLDocument): TStrings;
function getStringPostField(Field: string; ResponseDoc: IXMLDocument): String;
function getTStringSPostField(Field: string; ResponseDoc: IXMLDocument): TStrings;
function newComment(BlogURL: string;
username: string;
password: string;
post_id: string;
CommentStruct: TStructArray): string;
function newCategory(BlogURL: string;
username: string;
password: string;
CategoryStruct: TStructArray): string;
function getCategories(BlogURL: string;
username: string;
password: string): string;
function getTags(BlogURL: string;
username: string;
password: string): string;
end;
var
WP: TWP;
LastSend, LastReceived: String;
implementation
{$R *.dfm}
{ Private declarations }
function TWP.GetDocument(methodName: string): IXMLDocument;
var Root: IXMLNode;
begin
Result := NewXMLDocument();
Root := Result.CreateElement('methodCall','');
Result.DocumentElement := Root;
Root.AddChild('methodName').NodeValue := methodName;
Root.AddChild('params').NodeValue := '';
end;
procedure TWP.SetXMLParam(SimpleType: TSimpleType; Value: string; Document: PXMLDocument);
var Root: IXMLNode;
begin
if Document^.IsEmptyDoc then Exit; // Must provide a not empty xml
Root:=Document^.DocumentElement.ChildNodes.FindNode('params');
if Root=nil then Exit; //XML must have 'params' root
case SimpleType of
tsInt: Root.AddChild('param').AddChild('value').AddChild('int').NodeValue := Value;
tsI4: Root.AddChild('param').AddChild('value').AddChild('i4').NodeValue := Value;
tsString: Root.AddChild('param').AddChild('value').AddChild('string').NodeValue := Value;
tsDouble: Root.AddChild('param').AddChild('value').AddChild('double').NodeValue := Value;
tsDateTime:Root.AddChild('param').AddChild('value').AddChild('dateTime.iso8601').NodeValue := Value;
tsBase64: Root.AddChild('param').AddChild('value').AddChild('base64').NodeValue := Value;
tsBoolean: Root.AddChild('param').AddChild('value').AddChild('boolean').NodeValue := Value;
tsArray: Root.AddChild('param').AddChild('value').AddChild('array').NodeValue := Value;
end;
end;
procedure TWP.SetXMLStructure(Struct: TStructArray; Document: PXMLDocument);
var i, j:integer;
Root,Member, ArrayList: IXMLNode;
begin
if (Length(Struct)=0) or(Document^.IsEmptyDoc) then Exit;
Root:=Document^.DocumentElement.ChildNodes.FindNode('params').AddChild('param').AddChild('struct');
for i:= 0 to Length(Struct) - 1 do
if (Trim(Struct[i].Value) <> '')or(Struct[i].ValueList <> nil) then
begin
member:=Root.AddChild('member');
member.AddChild('name').NodeValue:=Struct[i].Name;
case Struct[i].SType of
tsInt,tsI4 : member.AddChild('value').AddChild('int').NodeValue:=Struct[i].Value;
tsString : member.AddChild('value').AddChild('string').NodeValue:=Struct[i].Value;
tsDouble : member.AddChild('value').AddChild('double').NodeValue:=Struct[i].Value;
tsDateTime : member.AddChild('value').AddChild('dateTime.iso8601').NodeValue:=Struct[i].Value;
tsBase64 : member.AddChild('value').AddChild('base64').NodeValue:=Struct[i].Value;
tsBoolean : member.AddChild('value').AddChild('boolean').NodeValue:=Struct[i].Value;
tsArray :
begin
if Struct[i].ValueList.Count > 0 then
begin
ArrayList := member.AddChild('value').AddChild('array').AddChild('data');
for j:=0 to Struct[i].ValueList.Count -1 do
ArrayList.AddChild('value').AddChild('string').NodeValue:=Struct[i].ValueList[j];
end
else member.AddChild('value').AddChild('string').NodeValue:='';
end;
end;
end;
end;
function TWP.SendQuery(Document: IXMLDocument; BlogURL: string): IXMLDocument;
var SQuery: TMemoryStream;
RQuery: TMemoryStream;
begin
SQuery := TMemoryStream.Create;
RQuery := TMemoryStream.Create;
Result := NewXMLDocument();
with IdHTTP do
begin
Document.SaveToStream(SQuery);
try
Post(BlogURL,SQuery, RQuery);
Result.LoadFromStream(RQuery,xetUTF_8);
except
Result := nil;
end;
end;
SQuery.Free;
RQuery.Free;
end;
function TWP.ParseErrors(Document: PXMLDocument): TStringList;
var i:integer;
List: IDOMNodeList;
code: string;
begin
List:=Document^.DOMDocument.getElementsByTagName('member');
Result:=TStringList.Create;
for i:=0 to List.length-1 do
begin
case i mod 2 of
0:code:=(List.item[i].lastChild.firstChild as IDOMNodeEx).text;
1:Result.Add('Code ' + code + ' : ' + (List.item[i].lastChild.firstChild as IDOMNodeEx).text);
end;
end;
end;
function TWP.GetTypeResult(ElementType: String; Document: PXMLDocument): String;
var List: IDOMNodeList;
begin
try
List:=Document^.DOMDocument.getElementsByTagName(ElementType);
Result := (List.item[0] as IDOMNodeEx).text;
except
Result := 'Could not read ' + ElementType + ' element';
end;
end;
{ Public declarations }
function TWP.sayHello(BlogURL: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('demo.sayHello');
SetXMLParam(tsString,'test',@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('string',@RecDoc);
end
else
result :='';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.listMethods(BlogURL: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('system.listMethods');
SetXMLParam(tsString,'',@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := RecDoc.XML.Text;
end
else
result :=''
end;
function TWP.newPost(BlogURL: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.newPost');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLStructure(PostStruct,@SendDoc);
SetXMLParam(tsBoolean,Publish,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('string',@RecDoc);
end
else
result :='Unknown error';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.editPost(BlogURL: string;
post_id: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.editPost');
SetXMLParam(tsInt,post_id,@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLStructure(PostStruct,@SendDoc);
SetXMLParam(tsBoolean,Publish,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('boolean',@RecDoc);
end
else
result :='Unknown error';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.getPost(BlogURL: string;
username: string;
password: string;
post_id: string): IXMLDocument;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.getPost');
SetXMLParam(tsInt,post_id,@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
Result := SendQuery(SendDoc,BlogURL);
LastSend := SendDoc.XML.Text;
LastReceived := Result.XML.Text;
end;
function TWP.getRecentPosts(BlogURL: string;
username: string;
password: string;
count: string): IXMLDocument;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.getRecentPosts');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLParam(tsInt,count,@SendDoc);
Result := SendQuery(SendDoc,BlogURL);
LastSend := SendDoc.XML.Text;
LastReceived := Result.XML.Text;
end;
function TWP.getPostsArrayField(Field: string; ResponseDoc: IXMLDocument): TStrings;
var
i,j:integer;
Values: IDOMNodeList;
Members: IDOMNodeList;
ResponseStream: TStream;
begin
Result := TStringList.Create;
if ResponseDoc<> nil then
begin
Values:=ResponseDoc.DOMDocument.getElementsByTagName('data').item[0].childNodes;
for i:= 0 to Values.length-1 do
begin
Members:=Values[i].firstChild.childNodes;
for j:=0 to Members.length - 1 do
if (Members[j].firstChild as IDOMNodeEx).text = Field then
Result.Append((Members[j].lastChild.firstChild as IDOMNodeEx).text);
end;
end;
end;
function TWP.getStringPostField(Field: string; ResponseDoc: IXMLDocument): String;
var
i:integer;
Members: IDOMNodeList;
ResponseStream: TStream;
begin
if ResponseDoc<> nil then
begin
Members:=ResponseDoc.DOMDocument.getElementsByTagName('struct').item[0].childNodes;
for i:=0 to Members.length - 1 do
if (Members[i].firstChild as IDOMNodeEx).text = Field then
Result := (Members[i].lastChild.firstChild as IDOMNodeEx).text;
end;
end;
function TWP.getTStringSPostField(Field: string; ResponseDoc: IXMLDocument): TStrings;
var
i, j: integer;
Members: IDOMNodeList;
ArrayList: IDOMNodeList;
ResponseStream: TStream;
begin
if ResponseDoc<> nil then
begin
Result := TStringList.Create;
Members := ResponseDoc.DOMDocument.getElementsByTagName('struct').item[0].childNodes;
for i:= 0 to Members.length - 1 do
if (Members[i].firstChild as IDOMNodeEx).text = Field then
begin
ArrayList := Members[i].lastChild.firstChild.firstChild.childNodes;
for j:=0 to ArrayList.length -1 do
Result.Append((ArrayList[j].firstChild.firstChild as IDOMNodeEx).text);
end;
end;
end;
function TWP.newComment(BlogURL: string;
username: string;
password: string;
post_id: string;
CommentStruct: TStructArray): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.newComment');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLParam(tsInt,post_id,@SendDoc);
SetXMLStructure(CommentStruct,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('int',@RecDoc);
end
else
result :='Empty respone from blog';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.newCategory(BlogURL: string;
username: string;
password: string;
CategoryStruct: TStructArray): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.newCategory');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLStructure(CategoryStruct,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Text
else
result := GetTypeResult('string',@RecDoc);
end
else
result :='';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.getCategories(BlogURL: string;
username: string;
password: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.getCategories');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Text
else
result := RecDoc.XML.Text;
end
else
result :=''
end;
function TWP.getTags(BlogURL: string;
username: string;
password: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.getTags');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Text
else
result := RecDoc.XML.Text;
end
else
result :=''
end;
procedure TWP.IdHTTPStatus(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: String);
begin
lbStatus.Caption := AStatusText;
end;
end.
This because I did not find any others libraries wich work with wordpress xml-rpc.
unit WPUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls,
XMLIntf, XMLDom, XMLDoc;
type
TSimpleType = (tsInt, tsI4, tsString, tsDouble, tsDateTime, tsBase64, tsBoolean, tsArray);
type
PXMLDocument = ^IXMLDocument;
type
TStructElement = packed record
Name : string; // element name
SType: TSimpleType; // element type
Value: string; // will contain value of element
ValueList: TStrings; // Used only in case of tsArray type
end;
type TStructArray = Array of TStructElement;
type
TWP = class(TForm)
IdHTTP: TIdHTTP;
IdAntiFreeze: TIdAntiFreeze;
lbStatus: TLabel;
Label1: TLabel;
procedure IdHTTPStatus(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: String);
private
{ Private declarations }
function GetDocument(methodName: string): IXMLDocument;
procedure SetXMLParam(SimpleType: TSimpleType; Value: string; Document: PXMLDocument);
procedure SetXMLStructure(Struct: TStructArray; Document: PXMLDocument);
function SendQuery(Document: IXMLDocument; BlogURL: string): IXMLDocument;
function ParseErrors(Document: PXMLDocument): TStringList;
function GetTypeResult(ElementType: String; Document: PXMLDocument): String;
public
{ Public declarations }
function sayHello(BlogURL: string): string;
function listMethods(BlogURL: string): string;
function newPost(BlogURL: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
function editPost(BlogURL: string;
post_id: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
function getPost(BlogURL: string;
username: string;
password: string;
post_id: string): IXMLDocument;
function getRecentPosts(BlogURL: string;
username: string;
password: string;
count: string): IXMLDocument;
function getPostsArrayField(Field: string; ResponseDoc: IXMLDocument): TStrings;
function getStringPostField(Field: string; ResponseDoc: IXMLDocument): String;
function getTStringSPostField(Field: string; ResponseDoc: IXMLDocument): TStrings;
function newComment(BlogURL: string;
username: string;
password: string;
post_id: string;
CommentStruct: TStructArray): string;
function newCategory(BlogURL: string;
username: string;
password: string;
CategoryStruct: TStructArray): string;
function getCategories(BlogURL: string;
username: string;
password: string): string;
function getTags(BlogURL: string;
username: string;
password: string): string;
end;
var
WP: TWP;
LastSend, LastReceived: String;
implementation
{$R *.dfm}
{ Private declarations }
function TWP.GetDocument(methodName: string): IXMLDocument;
var Root: IXMLNode;
begin
Result := NewXMLDocument();
Root := Result.CreateElement('methodCall','');
Result.DocumentElement := Root;
Root.AddChild('methodName').NodeValue := methodName;
Root.AddChild('params').NodeValue := '';
end;
procedure TWP.SetXMLParam(SimpleType: TSimpleType; Value: string; Document: PXMLDocument);
var Root: IXMLNode;
begin
if Document^.IsEmptyDoc then Exit; // Must provide a not empty xml
Root:=Document^.DocumentElement.ChildNodes.FindNode('params');
if Root=nil then Exit; //XML must have 'params' root
case SimpleType of
tsInt: Root.AddChild('param').AddChild('value').AddChild('int').NodeValue := Value;
tsI4: Root.AddChild('param').AddChild('value').AddChild('i4').NodeValue := Value;
tsString: Root.AddChild('param').AddChild('value').AddChild('string').NodeValue := Value;
tsDouble: Root.AddChild('param').AddChild('value').AddChild('double').NodeValue := Value;
tsDateTime:Root.AddChild('param').AddChild('value').AddChild('dateTime.iso8601').NodeValue := Value;
tsBase64: Root.AddChild('param').AddChild('value').AddChild('base64').NodeValue := Value;
tsBoolean: Root.AddChild('param').AddChild('value').AddChild('boolean').NodeValue := Value;
tsArray: Root.AddChild('param').AddChild('value').AddChild('array').NodeValue := Value;
end;
end;
procedure TWP.SetXMLStructure(Struct: TStructArray; Document: PXMLDocument);
var i, j:integer;
Root,Member, ArrayList: IXMLNode;
begin
if (Length(Struct)=0) or(Document^.IsEmptyDoc) then Exit;
Root:=Document^.DocumentElement.ChildNodes.FindNode('params').AddChild('param').AddChild('struct');
for i:= 0 to Length(Struct) - 1 do
if (Trim(Struct[i].Value) <> '')or(Struct[i].ValueList <> nil) then
begin
member:=Root.AddChild('member');
member.AddChild('name').NodeValue:=Struct[i].Name;
case Struct[i].SType of
tsInt,tsI4 : member.AddChild('value').AddChild('int').NodeValue:=Struct[i].Value;
tsString : member.AddChild('value').AddChild('string').NodeValue:=Struct[i].Value;
tsDouble : member.AddChild('value').AddChild('double').NodeValue:=Struct[i].Value;
tsDateTime : member.AddChild('value').AddChild('dateTime.iso8601').NodeValue:=Struct[i].Value;
tsBase64 : member.AddChild('value').AddChild('base64').NodeValue:=Struct[i].Value;
tsBoolean : member.AddChild('value').AddChild('boolean').NodeValue:=Struct[i].Value;
tsArray :
begin
if Struct[i].ValueList.Count > 0 then
begin
ArrayList := member.AddChild('value').AddChild('array').AddChild('data');
for j:=0 to Struct[i].ValueList.Count -1 do
ArrayList.AddChild('value').AddChild('string').NodeValue:=Struct[i].ValueList[j];
end
else member.AddChild('value').AddChild('string').NodeValue:='';
end;
end;
end;
end;
function TWP.SendQuery(Document: IXMLDocument; BlogURL: string): IXMLDocument;
var SQuery: TMemoryStream;
RQuery: TMemoryStream;
begin
SQuery := TMemoryStream.Create;
RQuery := TMemoryStream.Create;
Result := NewXMLDocument();
with IdHTTP do
begin
Document.SaveToStream(SQuery);
try
Post(BlogURL,SQuery, RQuery);
Result.LoadFromStream(RQuery,xetUTF_8);
except
Result := nil;
end;
end;
SQuery.Free;
RQuery.Free;
end;
function TWP.ParseErrors(Document: PXMLDocument): TStringList;
var i:integer;
List: IDOMNodeList;
code: string;
begin
List:=Document^.DOMDocument.getElementsByTagName('member');
Result:=TStringList.Create;
for i:=0 to List.length-1 do
begin
case i mod 2 of
0:code:=(List.item[i].lastChild.firstChild as IDOMNodeEx).text;
1:Result.Add('Code ' + code + ' : ' + (List.item[i].lastChild.firstChild as IDOMNodeEx).text);
end;
end;
end;
function TWP.GetTypeResult(ElementType: String; Document: PXMLDocument): String;
var List: IDOMNodeList;
begin
try
List:=Document^.DOMDocument.getElementsByTagName(ElementType);
Result := (List.item[0] as IDOMNodeEx).text;
except
Result := 'Could not read ' + ElementType + ' element';
end;
end;
{ Public declarations }
function TWP.sayHello(BlogURL: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('demo.sayHello');
SetXMLParam(tsString,'test',@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('string',@RecDoc);
end
else
result :='';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.listMethods(BlogURL: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('system.listMethods');
SetXMLParam(tsString,'',@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := RecDoc.XML.Text;
end
else
result :=''
end;
function TWP.newPost(BlogURL: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.newPost');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLStructure(PostStruct,@SendDoc);
SetXMLParam(tsBoolean,Publish,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('string',@RecDoc);
end
else
result :='Unknown error';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.editPost(BlogURL: string;
post_id: string;
username: string;
password: string;
PostStruct: TStructArray;
Publish: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.editPost');
SetXMLParam(tsInt,post_id,@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLStructure(PostStruct,@SendDoc);
SetXMLParam(tsBoolean,Publish,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('boolean',@RecDoc);
end
else
result :='Unknown error';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.getPost(BlogURL: string;
username: string;
password: string;
post_id: string): IXMLDocument;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.getPost');
SetXMLParam(tsInt,post_id,@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
Result := SendQuery(SendDoc,BlogURL);
LastSend := SendDoc.XML.Text;
LastReceived := Result.XML.Text;
end;
function TWP.getRecentPosts(BlogURL: string;
username: string;
password: string;
count: string): IXMLDocument;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('metaWeblog.getRecentPosts');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLParam(tsInt,count,@SendDoc);
Result := SendQuery(SendDoc,BlogURL);
LastSend := SendDoc.XML.Text;
LastReceived := Result.XML.Text;
end;
function TWP.getPostsArrayField(Field: string; ResponseDoc: IXMLDocument): TStrings;
var
i,j:integer;
Values: IDOMNodeList;
Members: IDOMNodeList;
ResponseStream: TStream;
begin
Result := TStringList.Create;
if ResponseDoc<> nil then
begin
Values:=ResponseDoc.DOMDocument.getElementsByTagName('data').item[0].childNodes;
for i:= 0 to Values.length-1 do
begin
Members:=Values[i].firstChild.childNodes;
for j:=0 to Members.length - 1 do
if (Members[j].firstChild as IDOMNodeEx).text = Field then
Result.Append((Members[j].lastChild.firstChild as IDOMNodeEx).text);
end;
end;
end;
function TWP.getStringPostField(Field: string; ResponseDoc: IXMLDocument): String;
var
i:integer;
Members: IDOMNodeList;
ResponseStream: TStream;
begin
if ResponseDoc<> nil then
begin
Members:=ResponseDoc.DOMDocument.getElementsByTagName('struct').item[0].childNodes;
for i:=0 to Members.length - 1 do
if (Members[i].firstChild as IDOMNodeEx).text = Field then
Result := (Members[i].lastChild.firstChild as IDOMNodeEx).text;
end;
end;
function TWP.getTStringSPostField(Field: string; ResponseDoc: IXMLDocument): TStrings;
var
i, j: integer;
Members: IDOMNodeList;
ArrayList: IDOMNodeList;
ResponseStream: TStream;
begin
if ResponseDoc<> nil then
begin
Result := TStringList.Create;
Members := ResponseDoc.DOMDocument.getElementsByTagName('struct').item[0].childNodes;
for i:= 0 to Members.length - 1 do
if (Members[i].firstChild as IDOMNodeEx).text = Field then
begin
ArrayList := Members[i].lastChild.firstChild.firstChild.childNodes;
for j:=0 to ArrayList.length -1 do
Result.Append((ArrayList[j].firstChild.firstChild as IDOMNodeEx).text);
end;
end;
end;
function TWP.newComment(BlogURL: string;
username: string;
password: string;
post_id: string;
CommentStruct: TStructArray): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.newComment');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLParam(tsInt,post_id,@SendDoc);
SetXMLStructure(CommentStruct,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Strings[0]
else
result := GetTypeResult('int',@RecDoc);
end
else
result :='Empty respone from blog';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.newCategory(BlogURL: string;
username: string;
password: string;
CategoryStruct: TStructArray): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.newCategory');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
SetXMLStructure(CategoryStruct,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Text
else
result := GetTypeResult('string',@RecDoc);
end
else
result :='';
LastSend := SendDoc.XML.Text;
LastReceived := RecDoc.XML.Text;
end;
function TWP.getCategories(BlogURL: string;
username: string;
password: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.getCategories');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Text
else
result := RecDoc.XML.Text;
end
else
result :=''
end;
function TWP.getTags(BlogURL: string;
username: string;
password: string): string;
var SendDoc: IXMLDocument;
RecDoc: IXMLDocument;
begin
SendDoc:=GetDocument('wp.getTags');
SetXMLParam(tsInt,'',@SendDoc);
SetXMLParam(tsString,username,@SendDoc);
SetXMLParam(tsString,password,@SendDoc);
RecDoc := SendQuery(SendDoc,BlogURL);
if (RecDoc <> nil) then
begin
if RecDoc.DocumentElement.ChildNodes.FindNode('fault')<>nil then
result := ParseErrors(@RecDoc).Text
else
result := RecDoc.XML.Text;
end
else
result :=''
end;
procedure TWP.IdHTTPStatus(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: String);
begin
lbStatus.Caption := AStatusText;
end;
end.
Ярлыки:
Delphi Unit,
WordPress,
XML-RCP
adobe flash plugin crash on browsers like firefox, opera, and others
Turn off hardware acceleration in Adobe Flash Player, to do this, right-click, for example, a video from YouTube, then click on "Parametters" and uncheck "Enable hardware acceleration" ... I personally helped, did not appear the inscription "There was a crash plugin Adobe Flash" and he began to work better.
Other guys said that the full uninstall (including registry clean) and reinstall helped them.
Other guys said that the full uninstall (including registry clean) and reinstall helped them.
Ярлыки:
adobe flash plugin crash,
firefox
четверг, 24 декабря 2009 г.
Lista Directoarelor Web din Moldova
Mai jos veti gasi lista a cyteva Directoare din Moldova.
Numele directorului | Google Pr |
---|---|
http://www.situri.md/ | 0 |
http://www.top20.md/ | 4 |
http://www.mdsites.info/ | 0 |
http://www.md-ix.info/ | 2 |
http://www.informatii.md/ | 2 |
http://www.link.md/ | 3 |
http://www.dyr.md/ | 1 |
http://www.computer.md/ro/catalogue/ | 0 |
http://www.lynk.md/ | 0 |
http://www.blogosfera.md/ | 4 |
http://www.vitrina-afacerilor.md/ | 0 |
http://dyr.wtravel.md/ | 1 |
http://www.ournet.md | 6 |
http://www.super.md | 1 |
http://www.try.md/ | 5 |
пятница, 11 декабря 2009 г.
keywords for stimul-cash
abacavir, abilify, acarbose, accupril, accutane, aceon, acetazolamide, aciphex, actigall, actonel, actoplus met, actos, acyclovir, adalat, adalat cc, adoxa, advair diskus, afeditab, aggrenox, albendazole, albenza, albuterol, albuterol sulfate, aldactone, alendronate, alesse, aleve, alfuzosin, allegra, allegra-d, allopurinol bp, altace, altocor, amantadine, amaryl, amiloride, amiloride-hydrochlorothiazide, amiodarone, amitriptyline, amlodipine, amlodipine – atrovastatin, amoxapine, amoxicillin, amoxicillin and clavulanate, amoxil, ampicillin, anafranil, anaprox, anastrozole, antabuse, apri, aralen, arava, arcoxia, aricept, arimidex, aripiprazole, aristocort, artane, asacol, asendin, asprin – dipyridamole, atacand, atacand-hctz, atarax, atenolol bp, atenolol-chlorthalidone, atomoxetine, atorvastatin, atrovent, augmentin, avalide, avandamet, avandaryl, avandia, avapro, avelox, aventyl, avodart, aygestin, azathioprine, azithromycin, azulfidine, baclofen, bactrim, benazepril, benazepril – amlodipine, benemid, benicor, benicor hct, benzac, benzoyl peroxide, betapace, biaxin, bicalutamide, biosoprolol – hydrochlorothiazide, bisoprolol, bisoprolol fumarate, boniva, brethaire, brethine, bromocriptine, bupropion, buspar, buspirone, cabergoline, caduet, cafergot, caffeine, calan, calcitriol, calcium acetate, canasa, candesartan, candesartan hydrochlorothiazide, capoten, captopril, carbamazepine, carbatrol, carbidopa-levodopa, cardizem, cardizem cd, cardura, carisoprodol, cartia, cartia cd, carvedilol, casodex, cataflam, cataflam xr, caverta, ceclor, ceclor cd, cefaclor, cefadroxil, cefdinir, cefixime, cefpodoxime, ceftin, cefuroxime, celebrex, celecoxib, celexa, cellcept, cephalexin, cetirizine, cetirizine-pseudoephedrine, chlorambucil, chloramphenicol, chloromycetin, chloroquine, chloroquine phosphate, chlorpromazine, chlorzoxazone, cialis, cialis soft, cilostazol, cipro, ciprofloxacin, citalopram hydrobromide, clarinex, clarithromycin, claritin, clemastine, cleocin, clindamycin, clofazimine, clomid, clomiphene, clomipramine, clonidine-chlorthalidone, clopidogrel, clorpres, clotrimazole, clozapine, clozaril, colospa, combivir, compazine, conjugated estrogens, cordarone, coreg, cotrimoxazole, coumadin, covera hs, crixivan, cyclophosphamide, cycloserine, cyclosporine, cycrin, cyklokapron, cymbalta, cyproheptadine, cytotec, cytoxan, danazol, danocrine, decadron, declomycin, deltasone, demadex, demeclocycline, depakote, desloratadine, desogen, desogestrel-ethinyl estradiol, desyrel, detrol, detrol la, dexamethasone, dexone, diamox, diclofenac, didanosine, didronel, diflucan, digitek, digoxin, dilacor, dilacor cd, dilantin, diltia, diltia cd, diltiazem, diltiazem cd, diltiazem hcl, diltiazem xl, diovan, diovan hct, disulfiram, ditropan, ditropan xl, divalproex, donepezil, doryx, dostinex, doxazosin, doxepin, doxycycline, droxia, duloxetine, duphaston, duricef, dutasteride, dydrogesterone, e-mycin, efavirenz, effexor, effexor xr, elavil, eldepryl, enalapril, enalapril-hydrochlorothiazide, endep, epitol, epivir, epivir hbv, epivir-hbv, ergotamine tartrate, eryc, erythromycin, escitalopram, esidrix, eskalith, esmolol hydrochloride, esomeprazole, estrace, estradiol, ethambutol, ethinyl estradiol, ethinyl estradiol and norgestrel, ethionamide, etidronate, etoposide, etoricoxib, eulexin, evista, exelon, ezetimibe, famciclovir, famotidine, famvir, fansidar, feldene, felodipine, femara, femcare, fenofibrate, fexofenadine, fexofenadine-pseudophedrine, finasteride, flagyl, flavoxate, flomax, floxin, fluconazole, fluoxetine, flutamide, fluticasone-salmeterol, fluvoxamine, fosamax, fosinopril, fulvicin, furadantin, furazolidone, furosemide, furoxone, gabapentin, gatifloxacin, gemfibrozil, generic, gengraf, geodon, glimepiride, glipizide, glipizide-metformin, glucophage, glucotrol, glucotrol xl, glucovance, glyburide(glibenclamide), glyburide(glibenclamide)-metformin, granisetron, grifulvin, grifulvin v, grisactin, griseofulvin, hydrea, hydrochlorothiazide, hydrodiuril, hydroxyurea, hydroxyzine, hytrin, hyzaar, ibandronae sodium, ibuprofen, ilosone, imitrex, imodium, imuran, indapamide, inderal, inderal la, indinavir, indocin, indomethacin, intagra, ipratropium bromide, irbesartan, irbesartan hydrochlorothiazide, isoptin, isordil sublingual, isordil titradose, isosorbide dinitrate, isosorbide mononitrate, isotretinoin, itraconazole, ivermectin, kamagra, kamagra oral jelly, kamagra soft, keflex, keftab, kemadrin, ketoconazole, ketorolac, kytril, labetalol, lamictal, lamictal dispersable, lamictal dispersible, lamisil, lamivudine, lamivudine – zidovudine, lamotrigine, lamprene, lanoxin, lansoprazole, lariam, lasix, leflunomide, lenor – 72, letrozole, leukeran, levaquin, levitra, levofloxacin, levonorgestrel, levonorgestrel ethinyl estradiol, levora, levothroid, levothyroxine, levothyroxine bp, levoxyl, lexapro, linezolid, lioresal, lipitor, lisinopril-hctz, lithium, lithobid, lithotabs, lomefloxacin, loperamide, lopid, lopressor, loratadine, losartan-hydrochlorothiazide, lotensin, lotrel, lovastatin, lovegra, loxapine, loxitane, lozol, luvox, lynoral, macrobid, macrodantin, maxalt, maxaquin, mebendazole, mebeverine, medroxyprogesterone, medroxyprogesterone usp, mefenamic acid, mefloquine, mellaril, meloxicam, mesalamine, mestinon, metaglip, metformin, metformin and pioglitazone, methocarbamol, methotrexate, methoxsalen, meticorten, metoclopramide, metoprolol, metronidazole, mevacor, mexiletine hydrochloride, mexitil, micardis, micardis hct, micronase, microzide, minipress, minocin, minocycline, minocycline hydrochloride, minomycin, mircette, mirtazapine, misoprostol, mobic, moduretic, monodox, monoket, monopril, montelukast, motrin, moxifloxacin, myambutol, mycophenolate mofetil, mysoline, nabumetone, nalidixic acid, naltrexone, naprelan, naproxen, nateglinide, nebilet, nebivolol, neggram, nelfinavir, neoral, neurontin, nexium, nifedipine, nimodipine, nimotop, nitrofurantoin, nizoral, nolvadex, nor-qd, norethindrone, norethindrone acetate, norfloxacin, norgestrel, noroxin, norplant, nortriptyline, norvasc, norvir, ofloxacin, olanzapine, olmesartan, olmesartan – hydrochlorothiazide, omeprazole, omnicef, ondansetron, oretic, orlistat, ortho micronor, ortho-cept, ovral, ovrette, oxcarbazepine, oxsoralen, oxybutynin, oxytrol, p.c.e, pacerone, pamelor, pantoprazole, parafon, parlodel, paroxetine, paxil, penicillin v, pentasa, pentoxifylline, pepcid, periactin, perindopril, periostat, phenazopyridine, phenergan, phenytek, phenytoin, phoslo, pioglitazone hydrochloride, piroxicam, plan b, plavix, plendil, pletal, ponstel, prandin, pravachol, pravastatin, prazosin, precose, prednisone, premarin, premarin 28s, prevacid, prilosec, primidone, principen, pro-banthine, probalan, probenecid, procardia, prochlorperazine, procyclidine, prograf, promethazine, propantheline, propecia, propranolol, proscar, protonix, proventil, proventil sulfate, provera, prozac, pyridium, pyridostigmine bromide, quetiapine, quinapril hydrochloride, rabeprazole sodium, raloxifene, ramipril, ranitidine, rapiflux, rebetol, reglan, relafen, remeron, renagel, repaglinide, requip, residronate, retrovir, revia, rheumatrex, ribavirin, rimonabant, risperdal, risperidone, ritonavir, rivastigimine, rizatriptan, robaxin, rocaltrol, ropinirole, rosiglitazone, rosiglitazone maleate – glimepiride, rosiglitazone-metformin, roxithromycin, rulide, sandimmune, sarafem, selegiline, seromycin, serophene, seroquel, sertraline, sevelamer hydrochloride, silagra, sildenafil citrate, simvastatin, simvastatin ezetimibe, sinemet, sinequan, singulair, slo-bid, slo-phyllin, soma, sorbitrate, sotalol, sparfloxacin, spironolactone usp, sporanox, starlix, stavudine, sterapred, stop smoking, strattera, stromectol, sulfadoxine-pyrimethamine, sulfasalazine, sumatriptan, sumycin, suprax, sustiva, symmetrel, synthroid, t-phyl, tacrolimus, tadalafil, tadalis sx, tamoxifen, tamsulosin, tavist, tegaserod, tegretol, telmisartan, telmisartan – hydrochlorothiazide, tenoretic, tenormin, tequin, terazosin, terbinafine, terbutaline, tetracycline, theo-24, theolair, theophylline, theox, thioridazine, thorazine, thyroxine, tiazac, tiazac cd, tiazac xl, ticlid, ticlopidine, tizanidine, tolterodine, toprol, toradol, torsemide, tramadol, trandate, tranexamic acid, trazodone, trecator-sc, trental, triacet, triamcinolone, tricor, triderm, trihexyphenidyl, trileptal, trimox, ultram, uni-dur, uniphyl, urispas, uroxatral, urso, ursodiol, valacyclovir, valsartan, valsartan-hydrochlorothiazide, valtrex, vanadom, vantin, vardenafil, vaseretic, vasotec, veetids, venlafaxine, ventolin sulfate, vepesid, verapamil, verelan, vermox, viagra, viagra soft, vibra-tab, vibramycin, videx, videx ec, vigora, viracept, volmax, voltaren, voltaren xr, voltarol, vospire, vytorin, warfarin, wellbutrin, xenical, zagam, zanaflex, zantac, zelnorm, zerit, zestoretic, zetia, ziac, ziagen, zidovudine, zimulti, ziprasidone, zithromax, zocor, zofran, zoloft, zovirax, zyban, zyloprim, zyprexa, zyrtec, zyrtec-d, zyvox
Ярлыки:
pharma,
stimul-cash
Подписаться на:
Сообщения (Atom)