Start
setCredentials("yourUSERname","yourAPIkeyGOEShere"); $Client->setDebug(0); // Debugging level $Client->setSSLVerifyPeer(false); $Client->setSSLVerifyHost(false); //$Mode = "create_or_update"; $Mode = "create"; $MethodName = "pages.save_one"; $SiteName = "sitename"; // your site name $PageName = "category:page-name"; // your page name - this will be reused since this code is creating pages in an autonumbered category. $Title = "Pizza Coupon Code"; // page title for new pages - reusing this to name all pages the same // tags must be in an array, even if just one tag (just for demo - won't be used) $TagArray = new xmlrpcval( array( new xmlrpcval("Tom"), new xmlrpcval("Dick"), new xmlrpcval("Harry") ), "array"); // page content. use \n to create line breaks. this content is formatted for form data. Some special characters need to be escaped (i.e \") $Content = array ( "series: 100\ncode: 100 222 \nissued: yyyymmdd \nexpires: \nsource: BV Visitors / RS Magazine \ndescription: Free GCB with $15 Order - BV Visitors Bureau & RS Magazine Ad\n", "series: 100\ncode: 100 223 \nissued: yyyymmdd \nexpires: \nsource: EA CVB AD \ndescription: Free GCB with $15 Order - Eagan CVB AD\n", "series: 100\ncode: 100 228 \nissued: yyyymmdd \nexpires: \nsource: BV Business Flier \ndescription: Free GCB with $15 Order - BV Large Order Flier to Businesses\n", "series: 100\ncode: 100 250 \nissued: yyyymmdd \nexpires: \nsource: Program Ad \ndescription: 4-Piece Breadsticks & Medium Pop for $5 - Program Ad\n", "series: 100\ncode: 100 417 \nissued: yyyymmdd \nexpires: 20091231\nsource: Parade Menu \ndescription: PARADE: Free GCB with $15 Order - Small Menus\n", "series: 100\ncode: 100 867 \nissued: yyyymmdd \nexpires: \nsource: MT Community Catalog \ndescription: Free GCB with $15.00 Purchase - MT Community Ed Catalog\n", "series: 200\ncode: 200 125 \nissued: yyyymmdd \nexpires: \nsource: Spa/Drake Arena \ndescription: $3.00 Off Large 1-Item Pizza - Spa/Drake Arena CG Only\n", "series: 200\ncode: 200 212 \nissued: yyyymmdd \nexpires: \nsource: Reading Club \ndescription: Free Solo 1-Item with $5.00 Purchase - Davanni's Reading Club\n", "series: 200\ncode: 200 215 \nissued: yyyymmdd \nexpires: \nsource: Event - CG \ndescription: Free Solo 1-Item with $5.00 Purchase - CG Only!\n", "series: 200\ncode: 200 228 \nissued: yyyymmdd \nexpires: \nsource: BV Flier \ndescription: $3.00 Off Large Pizza - BV Large Order Flier to Businesses\n", "series: 200\ncode: 200 404 \nissued: yyyymmdd \nexpires: 20091231\nsource: Apt. Move-In \ndescription: $2.00 Off Medium Pizza - 2 or more items - Apartment Move In\n", "series: 200\ncode: 200 415 \nissued: yyyymmdd \nexpires: 20090930\nsource: Valpak/ED Newspaper \ndescription: 1-Item Medium Pizza for $7.99 - Valpak & Edina NSP Insert\n", "series: 200\ncode: 200 418 \nissued: yyyymmdd \nexpires: 20110831\nsource: CR/GV Newspaper \ndescription: Large 1-Item Pizza for $10.00 - CR 10 Years, GV 10 Years\n", "series: 200\ncode: 200 450 \nissued: yyyymmdd \nexpires: \nsource: Price Comparison BT \ndescription: Price Comparison Box Topper - $1 Off Solo\n", "series: 200\ncode: 200 451 \nissued: yyyymmdd \nexpires: \nsource: Price Comparison BT \ndescription: Price Comparison Box Topper - $2 Off Medium\n", "series: 200\ncode: 200 452 \nissued: yyyymmdd \nexpires: \nsource: Price Comparison BT \ndescription: Price Comparison Box Topper - $3 Off Large\n", "series: 200\ncode: 200 626 \nissued: yyyymmdd \nexpires: 20090930\nsource: SV School Flier \ndescription: 1-Item Large Pizza for $9.99 - SV Schools\n", "series: 200\ncode: 200 629 \nissued: yyyymmdd \nexpires: unknown\nsource: BC In-house \ndescription: Medium 1-Item Pizza for $6.99 - BC after 4 PM\n", "series: 200\ncode: 200 630 \nissued: yyyymmdd \nexpires: unknown\nsource: BC In-house \ndescription: Large 1-Item Pizza for $9.99 - BC after 4 PM\n", "series: 200\ncode: 200 631 \nissued: yyyymmdd \nexpires: unknown\nsource: Flanny Shop Special \ndescription: Medium Cheese Pizza for $6.99 - after 2 or 4 PM\n", "series: 200\ncode: 200 632 \nissued: yyyymmdd \nexpires: unknown\nsource: Flanny Shops Special \ndescription: Large Cheese Pizza for $9.99 - after 2 or 4 PM\n", "series: 200\ncode: 200 633 \nissued: yyyymmdd \nexpires: unknown\nsource: Social Media \ndescription: Medium Cheese Pizza for $6.99 - 11 AM - 3 PM Game day only\n", "series: 200\ncode: 200 634 \nissued: yyyymmdd \nexpires: unknown\nsource: Social Media \ndescription: Large Cheese Pizza for $9.99 - 11 AM - 3 PM Game day only\n", "series: 200\ncode: 200 700 \nissued: yyyymmdd \nexpires: \nsource: Price Comparison BT \ndescription: $2.00 Off Medium Pizza - Price Comparison Box Topper\n", "series: 200\ncode: 200 702 \nissued: yyyymmdd \nexpires: \nsource: Direct Mail \ndescription: $3.00 Off Large Pizza - Money Mailer\n", "series: 200\ncode: 200 720 \nissued: yyyymmdd \nexpires: \nsource: Program Ad \ndescription: $2.00 Off Medium Pizza - 2010-11 Athletic Programs\n", "series: 200\ncode: 200 721 \nissued: yyyymmdd \nexpires: \nsource: Program Ad \ndescription: $3.00 Off Large Pizza - 2010-11 Athletic Programs\n", "series: 200\ncode: 200 802 \nissued: yyyymmdd \nexpires: \nsource: Money Mailer \ndescription: Slice & Pop for $3.99 - Money Mailer\n", "series: 200\ncode: 200 803 \nissued: yyyymmdd \nexpires: \nsource: Money Mailer \ndescription: Medium 1-Item Pizza for $8.99 - Money Mailer\n", "series: 200\ncode: 200 804 \nissued: yyyymmdd \nexpires: \nsource: Direct Mail \ndescription: Medium 1-Item Pizza for $8.99 - Money Mailer\n", "series: 200\ncode: 200 805 \nissued: yyyymmdd \nexpires: \nsource: Nat'l Night Out \ndescription: Free 2 Item Pizza - Nat'l Night Out 2008\n", "series: 200\ncode: 200 833 \nissued: yyyymmdd \nexpires: \nsource: SV Garage Sale/Teacher Flier \ndescription: Medium 1-Item Pizza for $9.99 - Savage Garage Sale & Teachers\n", "series: 200\ncode: 200 811 \nissued: yyyymmdd \nexpires: \nsource: BV Parade \ndescription: $2.00 Off Medium 2-Item Pizza - BV Fire Muster Parade (Aug. 13 2008)\n", "series: 200\ncode: 200 999 \nissued: yyyymmdd \nexpires: \nsource: MV Wallet Card \ndescription: But one pizza, get 50% off second pizza - MV HS Boys BB\n", "series: 300\ncode: 300 001 \nissued: yyyymmdd \nexpires: \nsource: DM/MM \ndescription: $1.00 Off Whole Hoagy - Money Mailer & Direct Mail Piece\n", "series: 300\ncode: 300 112 \nissued: yyyymmdd \nexpires: \nsource: Money Mailer \ndescription: BOGO: Buy Hoagy, Get Hoagy Free - Whole or Half\n", "series: 300\ncode: 300 114 \nissued: yyyymmdd \nexpires: \nsource: Election Ballot \ndescription: $1.00 Off Any Whole Hoagy - Election Ballot\n", "series: 300\ncode: 300 308 \nissued: yyyymmdd \nexpires: \nsource: HL Flier \ndescription: Free Garden Salad with Any Whole Hoagy - Uptown Flier\n", "series: 300\ncode: 300 415 \nissued: yyyymmdd \nexpires: 20090930\nsource: Valpak \ndescription: $1.00 Off Any Whole Hoagy - Valpak\n", "series: 300\ncode: 300 418 \nissued: yyyymmdd \nexpires: 20090630\nsource: CR Newspaper \ndescription: Whole Hoagies for $4.90 - CR 10 Years\n", "series: 300\ncode: 300 999 \nissued: yyyymmdd \nexpires: 20111121\nsource: Strib Steals \ndescription: Free Half Hoagy - Star Tribune Steals\n", "series: 400\ncode: 400 114 \nissued: yyyymmdd \nexpires: \nsource: Election Ballot \ndescription: Free Regular Beverage with $10 Purchase - Election Ballot\n", "series: 400\ncode: 400 911 \nissued: yyyymmdd \nexpires: 20100831\nsource: CG UST \ndescription: Free Regular Beverage Drink with any Purchase - UST Express Card\n", "series: 500\ncode: 500 035 \nissued: yyyymmdd \nexpires: \nsource: Insider \ndescription: 35 cent dessert - 35th Anniversary\n", "series: 500\ncode: 500 105 \nissued: yyyymmdd \nexpires: \nsource: Rainbow \ndescription: NEW Free Dessert (Brown) - Used/Handwritten on OLD Rainbow Sheets\n", "series: 500\ncode: 500 114 \nissued: yyyymmdd \nexpires: \nsource: Election Ballot \ndescription: Free Dessert with $10 Purchase - Election Ballot\n", "series: 500\ncode: 500 121 \nissued: yyyymmdd \nexpires: \nsource: Hotel Key Card \ndescription: Free Dessert with $20 Purchase - Hotel Key Cards\n", "series: 500\ncode: 500 422 \nissued: yyyymmdd \nexpires: \nsource: Courage Center/Running Room \ndescription: Free Dessert with Toy Donation - Courage Center Running Room\n", "series: 600\ncode: 600 114 \nissued: yyyymmdd \nexpires: \nsource: Election \ndescription: Free Side Garden Salad with $10 Purchase - Election Ballot\n", "series: 600\ncode: 600 805 \nissued: yyyymmdd \nexpires: 20080830\nsource: National Night Out \ndescription: Free Whole hgy, Calzone or Lasagna - National Night Out\n", "series: 700\ncode: 700 111 \nissued: yyyymmdd \nexpires: \nsource: Rainbow \ndescription: $1.00 Off Pasta with Meat Order - (Rainbow Series: Goldenrod)*\n", "series: 700\ncode: 700 114 \nissued: yyyymmdd \nexpires: \nsource: Election Ballot/ED Flier \ndescription: $1.00 Off Pasta with Meat Order - Election Ballot & ED Handout (Spring 09)\n", "series: 700\ncode: 700 229 \nissued: yyyymmdd \nexpires: \nsource: Flexdine \ndescription: Free Chips with Whole Hoagy - Flexdine\n", "series: 700\ncode: 700 415 \nissued: yyyymmdd \nexpires: 20090930\nsource: Valpak \ndescription: $1.00 Off Pasta Order - Valpak\n", "series: 700\ncode: 700 515 \nissued: yyyymmdd \nexpires: 20090930\nsource: Direct Mail \ndescription: $1.00 Off Pasta with Meat - Woody's/Davanni's DM Piece\n", "series: 700\ncode: 700 722 \nissued: yyyymmdd \nexpires: \nsource: Social Media \ndescription: $1.00 Off Pasta with Meat or Lasagna Order - (Rainbow Series: Goldenrod)*\n", "series: 700\ncode: 700 724 \nissued: yyyymmdd \nexpires: \nsource: Money Mailer \ndescription: $1.00 Off Soup - Money Mailer\n", "series: 800\ncode: 800 114 \nissued: yyyymmdd \nexpires: \nsource: BL Toro Flier \ndescription: 10% Off Any Order - Toro Tuesday Menu Flier\n", "series: 800\ncode: 800 115 \nissued: yyyymmdd \nexpires: \nsource: Money Mailer \ndescription: 10% Off Entire Order - Money Mailer\n", "series: 800\ncode: 800 212 \nissued: yyyymmdd \nexpires: \nsource: Special Event Coupon \ndescription: $1.00 Off with $5 Purchase - \"I attended a Special Event at DAVANNI'S!\"\n", "series: 800\ncode: 800 213 \nissued: yyyymmdd \nexpires: \nsource: HL Open Late \ndescription: $1.00 Off after 11:30 PM- Uptown Open Late\n", "series: 800\ncode: 800 302 \nissued: yyyymmdd \nexpires: 20121231 (varies)\nsource: Door Hanger/Rack Card \ndescription: $3 Off a $15 Order - BL, BV, EG, RG Rack Cards\n", "series: 800\ncode: 800 409 \nissued: yyyymmdd \nexpires: \nsource: Direct Mail \ndescription: 10% Off $50.00 Order - Small Postcards to Area Businesses\n", "series: 800\ncode: 800 415 \nissued: yyyymmdd \nexpires: 20090930\nsource: Valpak \ndescription: $10.00 Off $50.00 Order - Valpak\n", "series: 800\ncode: 800 416 \nissued: yyyymmdd \nexpires: 20111231 and 20111031\nsource: Rack Card/RS Menu Flier \ndescription: $5 OFF ANY $15 ORDER - EP Rack Card, RF Rack Card, PL Anniversary Flier, RS Road Closed Menu Flier\n", "series: 800\ncode: 800 417 \nissued: yyyymmdd \nexpires: 20091231\nsource: Small Menus \ndescription: $5 OFF ANY $15 ORDER - Small Menus\n", "series: 800\ncode: 800 418 \nissued: yyyymmdd \nexpires: 20100831\nsource: Enjoy the City \ndescription: FREE 4-Piece GCB with Purchase of Large Pizza - \"Enjoy the City\" Coupon Book\n", "series: 800\ncode: 800 724 \nissued: yyyymmdd \nexpires: \nsource: Parade Coupon \ndescription: $5.00 Off a $15 Order - Parade Coupon\n", "series: 800\ncode: 800 725 \nissued: yyyymmdd \nexpires: \nsource: Parade Coupon \ndescription: $5.00 Off a $20 Order - Parade Coupon\n", "series: 800\ncode: 800 726 \nissued: yyyymmdd \nexpires: \nsource: RS Magazine Ad \ndescription: $5.00 Off a $15 Order - RS MAG AD\n", "series: 800\ncode: 800 801 \nissued: yyyymmdd \nexpires: \nsource: RF Move DM \ndescription: $3.00 Off a $15 Order - RF Old Shop\n", "series: 800\ncode: 800 802 \nissued: yyyymmdd \nexpires: \nsource: RF Move DM \ndescription: $3.00 Off a $15 Order - RF NEW Shop\n", "series: 800\ncode: 800 803 \nissued: yyyymmdd \nexpires: \nsource: RF Flier \ndescription: $3.00 Off a $15 Order - RF X-Town Flier & Handout\n", "series: 800\ncode: 800 804 \nissued: yyyymmdd \nexpires: 20090930\nsource: RG DM/RF Parade \ndescription: $3.00 Off a $15 Order - RF Postcard Eat In / RF Parade Coupon / RG Direct Mail Piece\n", "series: 800\ncode: 800 805 \nissued: yyyymmdd \nexpires: \nsource: RF Direct Mail \ndescription: $3.00 Off a $15 Order - RF Postcard Delivery\n", "series: 800\ncode: 800 808 \nissued: yyyymmdd \nexpires: \nsource: HL 30 Anniv. \ndescription: $5.00 Off a $15 Order - UP 30th Anniversary Biz Card\n", "series: 800\ncode: 800 809 \nissued: yyyymmdd \nexpires: 20121231\nsource: RF Penn Fest \ndescription: $3.00 Off a $15 Order - RF Penn Fest 2012 Only\n", "series: 800\ncode: 800 812 \nissued: yyyymmdd \nexpires: \nsource: WB Days \ndescription: $3.00 Off a $20 Order - Woodbury Days\n", "series: 800\ncode: 800 822 \nissued: yyyymmdd \nexpires: \nsource: BC 30 Anniv. \ndescription: $5.00 Off a $15 Order - BC 30th Celebration 2011\n", "series: 800\ncode: 800 824 \nissued: yyyymmdd \nexpires: 20120931 (varies)\nsource: Door Hanger/Rack Card \ndescription: $5 off any $20 order - WB Small Menus; RVB Mag; BL, BV, EG, GV, RG Rip Cards\n", "series: 800\ncode: 800 888 \nissued: yyyymmdd \nexpires: \nsource: Coldwell Direct Mail \ndescription: $5.00 Off a $15 Order - DM Piece from Coldwell Banker Burnet\n", "series: 800\ncode: 800 901 \nissued: yyyymmdd \nexpires: unknown\nsource: Door Hanger \ndescription: $5 off any $15 order - Door Hanger\n", "series: 800\ncode: 800 930 \nissued: yyyymmdd \nexpires: 20110331\nsource: BL Toro Flier \ndescription: BL - TORO TUESDAYS - $2.00 Off Any Order with 2+ People\n", "series: 900\ncode: 900 112 \nissued: yyyymmdd \nexpires: 20120630\nsource: HL Rack Card \ndescription: $3 off $20 order - HL Rack Card\n", "series: 900\ncode: 900 303 \nissued: yyyymmdd \nexpires: \nsource: Menu Flier \ndescription: $5 Off $20 Order - Menu Flier\n", "series: 900\ncode: 900 300 \nissued: yyyymmdd \nexpires: 20141231\nsource: BL Heritage Days \ndescription: $3 Off a $15 Order - Bloomington Heritage Days Only\n", "series: 900\ncode: 900 302 \nissued: yyyymmdd \nexpires: \nsource: Menu Flier \ndescription: 10% Off $20 Order - Menu Flier\n", "series: 900\ncode: 900 303 \nissued: yyyymmdd \nexpires: \nsource: Menu Flier/BL Heritage Days \ndescription: $5 Off $20 Order - Menu Flier / Bloomington coupon - festival & Heritage Days\n", "series: 900\ncode: 900 404 \nissued: yyyymmdd \nexpires: \nsource: Box Topper \ndescription: $3 Off a $15 Order - \"Sticky\" Box Topper\n", ); // this second array is used to set up parent pages for the pages above. $ParentFullname = array ( "pizzacodes:_100", "pizzacodes:_100", "pizzacodes:_100", "pizzacodes:_100", "pizzacodes:_100", "pizzacodes:_100", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_200", "pizzacodes:_300", "pizzacodes:_300", "pizzacodes:_300", "pizzacodes:_300", "pizzacodes:_300", "pizzacodes:_300", "pizzacodes:_300", "pizzacodes:_400", "pizzacodes:_400", "pizzacodes:_500", "pizzacodes:_500", "pizzacodes:_500", "pizzacodes:_500", "pizzacodes:_500", "pizzacodes:_600", "pizzacodes:_600", "pizzacodes:_700", "pizzacodes:_700", "pizzacodes:_700", "pizzacodes:_700", "pizzacodes:_700", "pizzacodes:_700", "pizzacodes:_700", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_800", "pizzacodes:_900", "pizzacodes:_900", "pizzacodes:_900", "pizzacodes:_900", "pizzacodes:_900", "pizzacodes:_900", ); // start looping through the array and create the pages for($i = 0; $i < count($Content); ++$i) { $req = new xmlrpcmsg($MethodName); $req->addParam(new xmlrpcval( array("site" => new xmlrpcval($SiteName, "string"), "page" => new xmlrpcval($PageName, "string"), "content" => new xmlrpcval($Content[$i], "string"), "title" => new xmlrpcval($Title, "string"), "parent_fullname" => new xmlrpcval($ParentFullname[$i], "string"), "save_mode" => new xmlrpcval($Mode, "string")),"struct")); // "tags" => $TagArray, $res = $Client->send($req, 30, "https"); if(!$res->faultCode()) { // SUCCESS! echo $Content[$i]." - Parent Set to: ".$ParentFullname[$i]."
success!
";} else {echo "

Fault


\n". " Code: " . $res->faultCode() . "\n
". " Reason: " . $res->faultString() . "'\n
"; } } ?>
end