Results 1 to 7 of 7
  1. #1
    Newbie
    Join Date
    June 22nd, 2010
    Posts
    2
    Solving SAS Datafeed Problem
    I downloaded ShareASale's own datafeed and it takes this format:

    ProductID|Name|MerchantID|Merchant|Link|Thumbnail|BigImage|Price|RetailPrice|Category|SubCategory|Description|Custom1|Custom2|Custom3|Custom4|Custom5|LastUpdated|status|manufacturer|partnumber|merchantCategory|merchantSubcategory|shortDescription|ISBN|UPC
    453053976|Shareasale.com Affiliate

    Here is the actual feed.

    Code:
    Software|47|Shareasale.com|http://www.shareasale.com/m-pr.cfm?merchantID=47&userID=145286&productID=453053976|http://www.shareasale.com/images/n-logo.gif|http://www.shareasale.com/images/n-logo.gif|100|100|Business/Services|Advertising|Shareasale.com Affiliate Software can help you boost sales at your online store.  No technical requirements, and can be up and running in a day.|||||||instock|||||||
    Now compare that to this feed from another merchant on SAS:

    Code:
    470356419|Cubic Zirconia 3.0 Ct. Heart Classic CZ Pendant|25533|Birkat Elyon|http://www.shareasale.com/m-pr.cfm?merchantID=25533&userID=YOURUSERID&productID=470356419|http://birkatelyon.com/images/DP91W(3).jpg|http://birkatelyon.com/images/DP91W(3).jpg|325.00|325.00|Fashion|Jewelry|CZ pendant features a 3.0 carat heart shape cubic zirconia accented with a tappered baguette bail. Set in 14K white gold. Also available in 14K yellow gold. An Italian cable chain is included with your choice of 16 inch or 18 inch length.||||||2010-04-14 19:20:19.827|instock|Birkat Elyon|7339W|8|64|CZ pendant features a 3.0 carat heart shape cubic zirconia accented with a tappered baguette bail. Set in 14K white gold. Also available in 14K yellow gold. An Italian cable chain is included with your choice of 16 inch or 18 inch length.|||7339W|||||||0|http://birkatelyon.com/addcart.asp?style=7339W||||||||||||||||
    Do you see all the extra pipes at the end?

    Well, I'm trying to use a particular SAS plugin for wordpress and when I import the merchant feed, it keeps telling me that its in an unknown format.

    Could it be because of all those extra pipes which is not on ShareaSale's own feed?

    Any ideas?

    JH

  2. #2
    ABW Veteran Mr. Sal's Avatar
    Join Date
    January 18th, 2005
    Posts
    6,795
    Why would you want to use that first code "Software|47|..." in there?

    That's why you're getting that error.

  3. #3
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    All Shareasale feeds have the same format.
    Deborah Carney
    TeamLoxly.com BookGoodies.com ABCsPlus.com

  4. #4
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Jetheat -- If you look at this forum thread:

    http://www.abestweb.com/forums/showt...atafeed+format

    It explains about the datafeed format since changes were made August 1, 2009. It also gives a link to a very useful "Help" file within the SAS affiliate's dashboard that clarifies the extra pipe symbols at the end.
    Generate more fake news.

  5. #5
    Newbie
    Join Date
    June 22nd, 2010
    Posts
    2
    Thanks for all the answers.

    It seems like the code in the script may be outdated.

    It keeps telling me that the datafeed is of an unknown format when I try to import it into WP.

    Here is the code:
    Code:
    
    
    
    
    "; // Load the feeds $kbm_WPAPS_Feed_Lines = KBM_WPAPS_Load_Feeds ( $kbm_WPAPS_Feeder_Configuration, $kbm_WPAPS_Merchants_Configuration ); if ( $kbm_WPAPS_Feeder_Configuration [ 'ProcessMode' ] != 'CountOnly' ) { // Create the posts using feeds KBM_WPAPS_Create_Posts ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Output_Configuration , $kbm_WPAPS_Feed_Lines , $kbm_WPAPS_Plugins ) ; } // Let the user know if we have deleted the feeds or not KBM_WPAPS_Display_DataFeed_Deleted ( $kbm_WPAPS_Feeder_Configuration [ 'KeepFeeds' ] ) ; // Close up the page. //if ( ! KBM_WPAPS_Check_for_WordPress ( ) ) { // KBM_WPAPS_Display_HTML_Tail ( ) ; } KBM_WPAPS_Display_HTML_Tail ( ) ; //============================================================ // Functional Functions //============================================================ function KBM_WPAPS_Check_for_WordPress ( ) { $ReturnValue = true ; if ( ! function_exists ( 'get_option' ) ) { if ( ! file_exists( '../../../wp-config.php' ) ) { die ( 'There does not seem to be a wp-config.php file. ' . 'You must install WordPress before you import any entries.' ) ; } else { $ReturnValue = false ; } } return ( $ReturnValue ) ; } function KBM_WPAPS_Load_and_Check_Feeder_Settings ( ) { $ReturnValue = false ; $kbm_WPAPS_Feeder_Configuration = maybe_unserialize ( get_option ( 'kbm_ADPS2_DataFeederConfiguration' ) ) ; if ( ! $kbm_WPAPS_Feeder_Configuration ) { die ( 'Unable to load the Feeder configuration options. You must setup the WordPress options.' ) ; } else { if ( ! $kbm_WPAPS_Feeder_Configuration [ 'MinPostCount' ] ) { die ( 'Unable to load the Minumum Post Count option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Feeder_Configuration [ 'MaxPostCount' ] ) { die ( 'Unable to load the Maximum Post Count option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Feeder_Configuration [ 'MinEntriesPerPost' ] ) { die ( 'Unable to load the Minimum Entries per Post option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Feeder_Configuration [ 'MaxEntriesPerPost' ] ) { die ( 'Unable to load the Maximum Entries per Post option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Feeder_Configuration [ 'KeepFeeds' ] ) { die ( 'Unable to load the keep feeds option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Feeder_Configuration [ 'FilterPhrase' ] ) { die ( 'Unable to load the filter word option. You must setup the WordPress options.' ) ; } else { $ReturnValue = $kbm_WPAPS_Feeder_Configuration ; } } // $kbm_WPAPS_Feeder_Configuration ['HideLink'] = 'No'; return ( $ReturnValue ) ; } function KBM_WPAPS_Load_and_Check_Services_Settings ( $kbm_WPAPS_Feeder_Configuration ) { $ReturnValue = false ; $kbm_WPAPS_Services_Configuration = maybe_unserialize ( get_option ( 'kbm_ADPS2_ServicesConfig' ) ) ; if ( ! $kbm_WPAPS_Services_Configuration ) { die ( 'Unable to load the services configuration options. You must setup the WordPress options.' ) ; } else { if ( ! $kbm_WPAPS_Services_Configuration [ 'SAS_UserID' ] ) { die ( 'Unable to load the ShareASale UserID option. You must setup the WordPress options.' ) ; } else { $ReturnValue = $kbm_WPAPS_Services_Configuration ; } } return ( $ReturnValue ) ; } function KBM_WPAPS_Load_and_Check_Merchants_Settings ( ) { $ReturnValue = false ; $kbm_WPAPS_Merchants_Configuration = maybe_unserialize ( get_option ( 'kbm_ADPS2_Merchants' ) ) ; if ( ! $kbm_WPAPS_Merchants_Configuration ) { die ( 'Unable to load the Merchants configuration options. You must setup the WordPress options.' ) ; } else { if ( ( $kbm_WPAPS_Merchants_Configuration [ 0 ] [ 'Name' ] ) and ( $kbm_WPAPS_Merchants_Configuration [ 0 ] [ 'ID' ] ) ) { $ReturnValue = $kbm_WPAPS_Merchants_Configuration ; } else if ( ( $kbm_WPAPS_Merchants_Configuration [ 1 ] [ 'Name' ] ) and ( $kbm_WPAPS_Merchants_Configuration [ 1 ] [ 'ID' ] ) ) { $ReturnValue = $kbm_WPAPS_Merchants_Configuration ; } else if ( ( $kbm_WPAPS_Merchants_Configuration [ 2 ] [ 'Name' ] ) and ( $kbm_WPAPS_Merchants_Configuration [ 2 ] [ 'ID' ] ) ) { $ReturnValue = $kbm_WPAPS_Merchants_Configuration ; } else if ( ( $kbm_WPAPS_Merchants_Configuration [ 3 ] [ 'Name' ] ) and ( $kbm_WPAPS_Merchants_Configuration [ 3 ] [ 'ID' ] ) ) { $ReturnValue = $kbm_WPAPS_Merchants_Configuration ; } else if ( ( $kbm_WPAPS_Merchants_Configuration [ 4 ] [ 'Name' ] ) and ( $kbm_WPAPS_Merchants_Configuration [ 4 ] [ 'ID' ] ) ) { $ReturnValue = $kbm_WPAPS_Merchants_Configuration ; } else { die ( 'Unable to load any valid merchants. You must setup the WordPress options.' ) ; } } return ( $ReturnValue ) ; } function KBM_WPAPS_Load_and_Check_Output_Settings ( ) { $ReturnValue = false ; $kbm_WPAPS_Output_Configuration = maybe_unserialize ( get_option ( 'kbm_ADPS2_OutputConfig' ) ) ; if ( ! $kbm_WPAPS_Output_Configuration ) { die ( 'Unable to load the Output configuration options. You must setup the WordPress options.' ) ; } else { if ( ! $kbm_WPAPS_Output_Configuration [ 'WP_CategoryID' ] ) { die ( 'Unable to load the Catagory ID option. You must setup the WordPress options' ) ; } else if ( ! $kbm_WPAPS_Output_Configuration [ 'WP_AuthorID' ] ) { die ( 'Unable to load the Post Author option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Output_Configuration [ 'WP_AllowComments' ] ) { die ( 'Unable to load the Comment Status option. You must setup the WordPress options.' ) ; } else if ( ! $kbm_WPAPS_Output_Configuration [ 'WP_FutureLimit' ] ) { die ( 'Unable to load the last possible post date option. You must setup the WordPress options.' ) ; } else { $ReturnValue = $kbm_WPAPS_Output_Configuration ; } } return ( $ReturnValue ) ; } function KBM_WPAPS_Load_Feeds ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Merchants_Configuration ) { $kbm_WPAPS_Feed_Path = dirname ( __FILE__ ) . '/Feeds' ; if ( ! is_dir ( $kbm_WPAPS_Feed_Path ) ) { die ( 'Storage Location for the feeds does not exists.' ) ; } if ( 'Yes' == $kbm_WPAPS_Feeder_Configuration['FilterPartial'] ) { $kbm_WPAPS_Match_String = '/.*'.$kbm_WPAPS_Feeder_Configuration['FilterPhrase'].'.*/i' ; } else { $kbm_WPAPS_Match_String = '/.*\W'.$kbm_WPAPS_Feeder_Configuration['FilterPhrase'].'\W.*/i' ; } $kbm_WPAPS_Feed_Lines = array ( ) ; for ( $kbm_WPAPS_Merchant_Counter = 0 ; $kbm_WPAPS_Merchant_Counter < 5 ; $kbm_WPAPS_Merchant_Counter ++ ) { $kbm_WPAPS_Merchant_Name = $kbm_WPAPS_Merchants_Configuration [ $kbm_WPAPS_Merchant_Counter ] [ 'Name' ] ; $kbm_WPAPS_Merchant_ID = $kbm_WPAPS_Merchants_Configuration [ $kbm_WPAPS_Merchant_Counter ] [ 'ID' ] ; $kbm_WPAPS_Service_Name = $kbm_WPAPS_Merchants_Configuration [ $kbm_WPAPS_Merchant_Counter ] [ 'Service' ] ; $kbm_WPAPS_Merchant_File = $kbm_WPAPS_Feed_Path . '/' . $kbm_WPAPS_Service_Name . '_' . $kbm_WPAPS_Merchant_ID . '.txt' ; if ( ( $kbm_WPAPS_Merchant_Name == 'Merchant Name' ) or ( $kbm_WPAPS_Merchant_ID == 'ID #' ) ) { } else if ( ! $kbm_WPAPS_Merchant_ID ) { } else if ( file_exists( $kbm_WPAPS_Merchant_File ) == false ) { echo 'Datafeed File Does Not Exist:' ; echo $kbm_WPAPS_Merchant_File ; echo '

    Please ' . 'go click the refresh datafeeds button

    ' ; } else { if ( $kbm_WPAPS_Feeder_Configuration['LowMemoryMode'] == 'Yes' ) { $kbm_WPAPS_FileHandle = fopen ( $kbm_WPAPS_Merchant_File , 'r' ); if ( $kbm_WPAPS_FileHandle ) { while ( ! feof ( $kbm_WPAPS_FileHandle ) ) { $kbm_WPAPS_ProductString = fgets ( $kbm_WPAPS_FileHandle ); if ( $kbm_WPAPS_ProductString ) { if ( 'Filter Word' != $kbm_WPAPS_Feeder_Configuration['FilterPhrase'] ){ if ( preg_match ( $kbm_WPAPS_Match_String , $kbm_WPAPS_ProductString ) > 0 ) { $kbm_WPAPS_Feed_Lines[] = $kbm_WPAPS_ProductString; } } } } fclose ( $kbm_WPAPS_FileHandle ); } } else { $kbm_WPAPS_Merchant_Lines = file ( $kbm_WPAPS_Merchant_File ) ; if ( $kbm_WPAPS_Merchant_Lines == false ) { echo 'Bad file read:' . $kbm_WPAPS_Merchant_File . '' ; } else{ if ( 'Filter Word' == $kbm_WPAPS_Feeder_Configuration['FilterPhrase'] ){ $kbm_WPAPS_Feed_Lines = array_merge ( $kbm_WPAPS_Feed_Lines , $kbm_WPAPS_Merchant_Lines ) ; } else { $kbm_WPAPS_Feed_Lines = array_merge ( $kbm_WPAPS_Feed_Lines , preg_grep ( $kbm_WPAPS_Match_String , $kbm_WPAPS_Merchant_Lines ) ) ; } } } if ( $kbm_WPAPS_Feeder_Configuration [ 'KeepFeeds' ] == 'No' ) { unlink ( $kbm_WPAPS_Merchant_File ) ; } } } // Check to see if any of the files were available, and if not then abort the creation of the database entries. if ( count ( $kbm_WPAPS_Feed_Lines ) == 0 ) { die ( 'No file lines were available to import, not importing.' ) ; } else { //echo count ( $kbm_WPAPS_Feed_Lines ).' lines are available for import.'; //Below added by Kathy 5/28/08 echo count ( $kbm_WPAPS_Feed_Lines ).' products match your search.

    '; } return ( $kbm_WPAPS_Feed_Lines ) ; } function KBM_WPAPS_Insert_Post ( $kbm_WPAPS_Post_Title , $kbm_WPAPS_Post_Body , $kbm_WPAPS_Post_Date , $kbm_WPAPS_Output_Configuration ) { // initialize post object $kbm_WPAPS_Post_Array = array ( ) ; // fill object $kbm_WPAPS_Post_Array [ 'post_title' ] = $kbm_WPAPS_Post_Title ; $kbm_WPAPS_Post_Array [ 'post_content' ] = $kbm_WPAPS_Post_Body ; $kbm_WPAPS_Post_Array [ 'post_date' ] = $kbm_WPAPS_Post_Date ; $kbm_WPAPS_Post_Array [ 'post_status' ] = 'publish' ; $kbm_WPAPS_Post_Array [ 'post_author' ] = $kbm_WPAPS_Output_Configuration [ 'WP_AuthorID' ] ; $kbm_WPAPS_Post_Array [ 'comment_status' ] = $kbm_WPAPS_Output_Configuration [ 'WP_AllowComments' ] ; $kbm_WPAPS_Post_Array [ 'post_category' ] = array( $kbm_WPAPS_Output_Configuration [ 'WP_CategoryID' ] ) ; //KBM_WPAPS_Display_New_Post_Data ( $kbm_mypost->post_title, $kbm_mypost->post_date ); // ======== INSERTING ========= // Comment IN when Debugging // echo $kbm_WPAPS_Post_Body.''; // echo 'Post was not inserted.' . "\n" ; } // feed object to wp_insert_post //comment out when debugging wp_insert_post ( $kbm_WPAPS_Post_Array ) ; } function KBM_WPAPS_Get_Post_Time ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Output_Configuration , $kbm_WPAPS_Post_Counter ) { if ( $kbm_WPAPS_Post_Counter < $kbm_WPAPS_Feeder_Configuration [ 'MaxEntriesPerPost' ] ) { //munge up dates a bit more //post a few quickly $kbm_WPAPS_Future_Minutes = rand ( $kbm_WPAPS_Feeder_Configuration [ 'MinPostCount' ] , $kbm_WPAPS_Feeder_Configuration [ 'MaxPostCount' ] ) ; } else { //then put in further spacing out $kbm_WPAPS_Future_Minutes= rand ( 0 , $kbm_WPAPS_Output_Configuration [ 'WP_FutureLimit' ] ) ; } $kbm_WPAPS_Future_Time = strtotime ( '+' . $kbm_WPAPS_Future_Minutes . ' minutes' ) ; $kbm_WPAPS_Post_Time = date ( 'Y-m-d H:i:s' , $kbm_WPAPS_Future_Time ) ; //space them out return ( $kbm_WPAPS_Post_Time ) ; } function KBM_WPAPS_Get_Post_Data ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Output_Configuration ,$kbm_WPAPS_Product_Count_Max , $kbm_WPAPS_Feed_Lines , $kbm_WPAPS_Plugins ) { //Reset variables // Checking for obseletion // unset ( $change ) ; // unset ( $body ) ; // unset ( $tname ) ; $kbm_WPAPS_Product_Count = 0 ; // keep track of how many items we have while ( $kbm_WPAPS_Product_Count < $kbm_WPAPS_Product_Count_Max ) { $PostArray = KBM_WPAPS_Get_Random_Product_Text ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Feed_Lines , $kbm_WPAPS_Plugins ) ; $kbm_WPAPS_Post_New_Text = $PostArray [ 0 ] ; $kbm_WPAPS_Post_Title = $PostArray [ 1 ] ; $kbm_WPAPS_Post_Text = '

    '.$kbm_WPAPS_Post_New_Text.'
    '."\n". $kbm_WPAPS_Post_Text ; $kbm_WPAPS_Product_Count ++ ; } // end item counter while loop return ( array ( 'Body' => $kbm_WPAPS_Post_Text , 'Name' => $kbm_WPAPS_Post_Title ) ) ; } function KBM_WPAPS_Create_Posts ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Output_Configuration , $kbm_WPAPS_Feed_Lines , $kbm_WPAPS_Plugins ) { $kbm_WPAPS_Post_Max = rand ( $kbm_WPAPS_Feeder_Configuration [ 'MinPostCount' ] , $kbm_WPAPS_Feeder_Configuration [ 'MaxPostCount' ] ) ; // total posts to load at once. RANDOM $kbm_WPAPS_Post_Count = 1 ; // track number of posts while ( $kbm_WPAPS_Post_Count <= $kbm_WPAPS_Post_Max ) { $kbm_WPAPS_Post_Products_Max = rand ( $kbm_WPAPS_Feeder_Configuration [ 'MinEntriesPerPost' ] , $kbm_WPAPS_Feeder_Configuration[ 'MaxEntriesPerPost' ] ) ; // total items per post. RANDOM $kbm_WPAPS_Post_Data = KBM_WPAPS_Get_Post_Data ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Output_Configuration , $kbm_WPAPS_Post_Products_Max , $kbm_WPAPS_Feed_Lines , $kbm_WPAPS_Plugins ) ; //echo "Body is: $kbm_WPAPS_Post_Data [ 'Body' ]"; //debug $kbm_WPAPS_Post_Date = KBM_WPAPS_Get_Post_Time ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Output_Configuration , $kbm_WPAPS_Post_Count ) ; if ( $kbm_WPAPS_Feeder_Configuration [ 'ProcessMode' ] == 'DryRun' ) { // echo '

    ' . $kbm_WPAPS_Post_Data [ 'Name' ] . ' - ' . $kbm_WPAPS_Post_Date . '
    ' . $kbm_WPAPS_Post_Data [ 'Body' ] ; ?>

    ?@ABCDE // 7FGHIJKLMNO // 8PQRSTUVWXY // 9Z[\]^_`abc // 0defghijklm // 1nopqrstuvw // 2xyz{|}~¦ // ------------ Mini Ascii Chart ------------ // 32 decimal = 20 hex // 128 decimal = 80 hex // Strip non ascii characters from the string $kbm_WPAPS_Dirty_String = preg_replace ( '/[\x0-\x1F|\x7F-\xFF]/' , '' , $kbm_WPAPS_Dirty_String ) ; // Debug the Filters // if ( $kbm_WPAPS_Dirty_String != $kbm_WPAPS_Check_Dirty_String ) { // echo "Non-Ascii Characters Filtered: $$kbm_WPAPS_Dirty_String \n" ; // $kbm_WPAPS_Check_Dirty_String = $kbm_WPAPS_Dirty_String ; } // Handle Murky Greater Than Symbols $kbm_WPAPS_Wrong_Greater_Than_Tokens = 'andgt;|\>' ; $kbm_WPAPS_Dirty_String = preg_replace ( '/(' . $kbm_WPAPS_Wrong_Greater_Than_Tokens . ')/' , '>' , $kbm_WPAPS_Dirty_String ) ; // Handle Murky Less Than Symbols $kbm_WPAPS_Wrong_Less_Than_Tokens = 'andlt;|\<'; $kbm_WPAPS_Dirty_String = preg_replace ( '/(' . $kbm_WPAPS_Wrong_Less_Than_Tokens.')/' , '<' , $kbm_WPAPS_Dirty_String ) ; // Debug the Filters // if ( $kbm_WPAPS_Dirty_String != $kbm_WPAPS_Check_Dirty_String ) { // echo "Murky Tag Characters Filtered: $kbm_WPAPS_Dirty_String \n" ; // $kbm_WPAPS_Check_Dirty_String = $kbm_WPAPS_Dirty_String ; } // Change all the Paragraph Tags to 2 NewLines so that browser will display some space. $kbm_WPAPS_Dirty_String = str_replace ( '

    ' , "\n\n" , $kbm_WPAPS_Dirty_String ) ; $kbm_WPAPS_Dirty_String = str_replace ( '

    ' , "\n\n" , $kbm_WPAPS_Dirty_String ) ; // Debug the Filters // if ( $kbm_WPAPS_Dirty_String != $kbm_WPAPS_Check_Dirty_String ) { // echo "Paragraph Tags Filtered: $kbm_WPAPS_Dirty_String \n" ; // $kbm_WPAPS_Check_Dirty_String = $kbm_WPAPS_Dirty_String ; } // Strip all the HTML tags our of the string. $kbm_WPAPS_Dirty_String = strip_tags ( $kbm_WPAPS_Dirty_String ) ; // Debug the Filters // if ( $kbm_WPAPS_Dirty_String != $kbm_WPAPS_Check_Dirty_String ) { // echo "HTML Tags Filtered: $kbm_WPAPS_Dirty_String \n" ; // $kbm_WPAPS_Check_Dirty_String = $kbm_WPAPS_Dirty_String ; } return ( $kbm_WPAPS_Dirty_String ) ; } // Splits a ShareASale feed into it's product components function KBM_WPAPS_Get_Product_Data_From_Line ( $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Product_Line ) { $kbm_WPAPS_Product = array ( ) ; $kbm_WPAPS_Product['Service_Number'] = 0; $kbm_WPAPS_Product['User_ID'] = $kbm_WPAPS_Service_Configuration['SAS_UserID'] ; // Split the line into it's data fields $kbm_WPAPS_Product_Array = explode ( '|' , $kbm_WPAPS_Product_Line ) ; // Get the Product ID $kbm_WPAPS_Product['Product_ID'] = $kbm_WPAPS_Product_Array [ 0 ] ; // Get the Product Name // $kbm_WPAPS_Product_Name = filter_var( $kbm_WPAPS_Product_Array [ 1 ] , FILTER_SANITIZE_STRING ); $kbm_WPAPS_Product['Product_Name'] = KBM_WPAPS_Filter_String ( $kbm_WPAPS_Product_Array [ 1 ] ) ; // Get the Merchant ID $kbm_WPAPS_Product['Merchant_ID'] = $kbm_WPAPS_Product_Array [ 2 ] ; // Get the Merchant Name $kbm_WPAPS_Product['Merchant_Name'] = $kbm_WPAPS_Product_Array [ 3 ] ; // Get the Merchant Name $kbm_WPAPS_Product['Product_Link'] = str_replace ( 'YOURUSERID' , $kbm_WPAPS_Service_Configuration['SAS_UserID'] , $kbm_WPAPS_Product_Array [ 4 ] ); //if there's a thumbnail, use it if ( $kbm_WPAPS_Product_Array [ 5 ] != '' ) { $kbm_WPAPS_Product['Product_Image'] = $kbm_WPAPS_Product_Array [ 5 ] ; } // no thumbnail, use full image. else { $kbm_WPAPS_Product['Product_Image'] = $kbm_WPAPS_Product_Array [ 6 ] ; } $kbm_WPAPS_Product['Product_Price'] = $kbm_WPAPS_Product_Array [ 7 ] ; $kbm_WPAPS_Product['Product_Retail_Price'] = $kbm_WPAPS_Product_Array [ 8 ] ; $kbm_WPAPS_Product['Product_Category'] = $kbm_WPAPS_Product_Array [ 9 ] ; $kbm_WPAPS_Product['Product_SubCategory'] = $kbm_WPAPS_Product_Array [ 10 ] ; // Lets handle the Product Description $kbm_WPAPS_Product['Product_Description'] = KBM_WPAPS_Filter_String ( $kbm_WPAPS_Product_Array [ 11 ] ) ; $kbm_WPAPS_Product['Custom1'] = $kbm_WPAPS_Product_Array [ 12 ] ; $kbm_WPAPS_Product['Custom2'] = $kbm_WPAPS_Product_Array [ 13 ] ; $kbm_WPAPS_Product['Custom3'] = $kbm_WPAPS_Product_Array [ 14 ] ; $kbm_WPAPS_Product['Custom4'] = $kbm_WPAPS_Product_Array [ 15 ] ; $kbm_WPAPS_Product['Custom5'] = $kbm_WPAPS_Product_Array [ 16 ] ; $kbm_WPAPS_Product['Last_Updated'] = $kbm_WPAPS_Product_Array [ 17 ] ; $kbm_WPAPS_Product['Product_Status'] = $kbm_WPAPS_Product_Array [ 18 ] ; $kbm_WPAPS_Product['Product_Manufacturer'] = $kbm_WPAPS_Product_Array [ 19 ] ; $kbm_WPAPS_Product['Product_Part_Number'] = $kbm_WPAPS_Product_Array [ 20 ] ; $kbm_WPAPS_Product['Merchant_Category'] = $kbm_WPAPS_Product_Array [ 21 ] ; $kbm_WPAPS_Product['Merchant_Sub_Category'] = $kbm_WPAPS_Product_Array [ 22 ] ; $kbm_WPAPS_Product['Short_Description'] = $kbm_WPAPS_Product_Array [ 23 ] ; $kbm_WPAPS_Product['ISBN'] = $kbm_WPAPS_Product_Array [ 24 ] ; $kbm_WPAPS_Product['UPC'] = $kbm_WPAPS_Product_Array [ 25 ] ; $kbm_WPAPS_Product['SKU'] = $kbm_WPAPS_Product_Array [ 26 ] ; $kbm_WPAPS_Product['CrosSell'] = $kbm_WPAPS_Product_Array [ 27 ] ; $kbm_WPAPS_Product['MerchantGroup'] = $kbm_WPAPS_Product_Array [ 28 ] ; $kbm_WPAPS_Product['MerchantSubgroup'] = $kbm_WPAPS_Product_Array [ 29 ] ; $kbm_WPAPS_Product['CompatibleWith'] = $kbm_WPAPS_Product_Array [ 30 ] ; $kbm_WPAPS_Product['CompareTo'] = $kbm_WPAPS_Product_Array [ 31 ] ; $kbm_WPAPS_Product['QuantityDiscount'] = $kbm_WPAPS_Product_Array [ 32 ] ; $kbm_WPAPS_Product['Bestseller'] = $kbm_WPAPS_Product_Array [ 33 ] ; $kbm_WPAPS_Product['AddToCartURL'] = $kbm_WPAPS_Product_Array [ 34 ] ; $kbm_WPAPS_Product['ReviewsRSSURL'] = $kbm_WPAPS_Product_Array [ 35 ] ; $kbm_WPAPS_Product['Option1'] = $kbm_WPAPS_Product_Array [ 36 ] ; $kbm_WPAPS_Product['Option2'] = $kbm_WPAPS_Product_Array [ 37 ] ; $kbm_WPAPS_Product['Option3'] = $kbm_WPAPS_Product_Array [ 38 ] ; $kbm_WPAPS_Product['Option4'] = $kbm_WPAPS_Product_Array [ 39 ] ; $kbm_WPAPS_Product['Option5'] = $kbm_WPAPS_Product_Array [ 40 ] ; $kbm_WPAPS_Product['Reserved1'] = $kbm_WPAPS_Product_Array [ 41 ] ; $kbm_WPAPS_Product['Reserved2'] = $kbm_WPAPS_Product_Array [ 42 ] ; $kbm_WPAPS_Product['Reserved3'] = $kbm_WPAPS_Product_Array [ 43 ] ; $kbm_WPAPS_Product['Reserved4'] = $kbm_WPAPS_Product_Array [ 44 ] ; $kbm_WPAPS_Product['Reserved5'] = $kbm_WPAPS_Product_Array [ 45 ] ; $kbm_WPAPS_Product['Reserved6'] = $kbm_WPAPS_Product_Array [ 46 ] ; $kbm_WPAPS_Product['Reserved7'] = $kbm_WPAPS_Product_Array [ 47 ] ; $kbm_WPAPS_Product['Reserved8'] = $kbm_WPAPS_Product_Array [ 48 ] ; $kbm_WPAPS_Product['Reserved9'] = $kbm_WPAPS_Product_Array [ 49 ] ; $kbm_WPAPS_Product['Reserved10'] = $kbm_WPAPS_Product_Array [ 50 ] ; //Left for debug purposes //echo "$kbm_WPAPS_Product['Product_ID']...

    $kbm_WPAPS_Product['Product_Description']

    "; return ( $kbm_WPAPS_Product ) ; } function KBM_WPAPS_Get_Random_Product_Text ( $kbm_WPAPS_Feeder_Configuration , $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Data_Lines , $kbm_WPAPS_Plugins ) { // Choose a line at random from all of those available $kbm_WPAPS_Product_Line = $kbm_WPAPS_Data_Lines [ array_rand ( $kbm_WPAPS_Data_Lines ) ] ; $kbm_WPAPS_Product = ''; // Figure out how to tell the difference between sharasale line and commisionjunction lines if ( 26 == count ( explode ( '|' , $kbm_WPAPS_Product_Line ) ) ) { // Now that we know what kind of line it is we get the product data from the line. $kbm_WPAPS_Product = KBM_WPAPS_Get_Product_Data_From_Line ( $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Product_Line ) ; } else if ( 0 < count ( $kbm_WPAPS_Plugins ) ){ foreach ( $kbm_WPAPS_Plugins as $kbm_WPAPS_CurrentPlugin ){ if ( '' == $kbm_WPAPS_Product ) { $kbm_WPAPS_Product = call_user_func( 'ADPS2_'.$kbm_WPAPS_CurrentPlugin . '_Check_Line', $kbm_WPAPS_Service_Configuration , $kbm_WPAPS_Product_Line ) ; } } } if ( '' == $kbm_WPAPS_Product ) { die ( 'Unknown product format.'.$kbm_WPAPS_Product_Line.'' ) ; } // Build the link structure for the product since we will be using it several times if ( 'No' == $kbm_WPAPS_Feeder_Configuration ['HideLink'] ) { // Original Link Structure: $kbm_WPAPS_Product['Product_Link'] = $kbm_WPAPS_Product [ 'Product_Link' ] ; } else { // Hidden Link Structure : $kbm_WPAPS_Product['Product_Link'] = '/shop/' . $kbm_WPAPS_Product['User_ID'] . '/' . $kbm_WPAPS_Product['Service_Number'] . '/' . $kbm_WPAPS_Product ['Merchant_ID'] . '/' . $kbm_WPAPS_Product ['Product_ID'] . '/' ; } $kbm_WPAPS_New_Window = ' '; if ( 'Yes' == $kbm_WPAPS_Feeder_Configuration [ 'NewWindow' ] ){ $kbm_WPAPS_New_Window = ' TARGET="_blank" '; } // Build the Product's Post Text $kbm_WPAPS_Product_Text = '' . '' . $kbm_WPAPS_Product['Product_Name'] . '' . '

    ' . $kbm_WPAPS_Product['Product_Description'] . '

    ' . 'Check Prices at ' . $kbm_WPAPS_Product['Merchant_Name'] . '' . '
    ' ; //Left for debug purposes //echo $kbm_WPAPS_Product['Text']; //Left for debug purposes //echo "Products gotten...\n"; // Return the product post text and the product name for the title. return ( array ( $kbm_WPAPS_Product_Text , $kbm_WPAPS_Product['Product_Name'] ) ) ; } function KBM_WPAPS_Check_and_Load_Services ( $kbm_WPAPS_Service_Configuration ) { kbm_debug ( 'function START KBM_WPAPS_Check_and_Load_Services' ); kbm_debug ( ' Services Configuration starts:' ); kbm_debug ( $kbm_WPAPS_Service_Configuration ); kbm_debug ( ' Services Configuration ends' ); $kbm_ADPS2_Plugins = array(); kbm_debug ( ' setup the plugins array' ); // This is done for the 4.x version of PHP $kbm_ADPS2_File_Names_Array = array(); kbm_debug ( ' setup the file names array' ); $kbm_dir_handle = opendir ( dirname ( __FILE__ ) ) ; kbm_debug ( ' open the directory that this script is in' ); $kbm_dir_filename = readdir ( $kbm_dir_handle ) ; kbm_debug ( ' read the first file name in the directory: '.$kbm_dir_filename ); while (!( $kbm_dir_filename === false )) { kbm_debug ( ' still able to read file names' ); $kbm_ADPS2_File_Names_Array [] = $kbm_dir_filename ; kbm_debug ( ' attach '.$kbm_dir_filename.' filename to the end of the array' ); $kbm_dir_filename = readdir ( $kbm_dir_handle ) ; kbm_debug ( ' read the next file name in the directory: '.$kbm_dir_filename ); } closedir ( $kbm_dir_handle ) ; kbm_debug ( ' close our directory handle' ); // $kbm_ADPS2_File_Names_Array = scandir ( dirname ( __FILE__ ) ); foreach ( $kbm_ADPS2_File_Names_Array as $kbm_ADPS2_File_Name ) { kbm_debug ( ' checking if '.$kbm_ADPS2_File_Name.' is a valid plugin file.' ); $kbm_ADPS2_Match_Array = array (); kbm_debug ( ' setup match array' ); if ( 0 < preg_match ( '/ADPS2_SERVICE_(.*)\.php$/i' , $kbm_ADPS2_File_Name , $kbm_ADPS2_Match_Array ) ) { kbm_debug ( ' '.$kbm_ADPS2_File_Name.' matches our naming scheme' ); if ( 1 == include_once ( $kbm_ADPS2_File_Name ) ) { kbm_debug ( ' '.$kbm_ADPS2_File_Name.' successfully included' ); if ( function_exists ( 'ADPS2_'.$kbm_ADPS2_Match_Array [ 1 ] . '_Load_Settings' ) ) { kbm_debug ( ' '.$kbm_ADPS2_File_Name.' has a load settings function' ); if ( true == call_user_func( 'ADPS2_'.$kbm_ADPS2_Match_Array [ 1 ] . '_Load_Settings', $kbm_WPAPS_Service_Configuration ) ) { kbm_debug ( ' called load settings function' ); $kbm_ADPS2_Plugins[] = $kbm_ADPS2_Match_Array [ 1 ] ; kbm_debug ( ' attached '.$kbm_ADPS2_Match_Array [ 1 ].' to the list of plugins' ); } } } } } kbm_debug ( 'function DONE KBM_WPAPS_Check_and_Load_Services' ); return ( $kbm_ADPS2_Plugins ) ; } //============================================================ // Display Functions //============================================================ ?> WordPress Affiliate Profit System Version 2 Plugin

    The Affiliate Datafeed Profit System

    Generating New Content... - added Items Included:

    Finished: WARNING, you are in dry run mode only. Nothing has been actually posted to your website. The posts above are EXAMPLES of the content that will be created. If you're ready to create real posts for your website, please go back to the ADPS admin and change from "Dry Run" mode to "Post Entries" mode in the Product Filtering section.

    Finished: New Posts Added

    Datafeeds Deleted

    Datafeeds were Kept for use again later

    All done. View Your Site |

    Look at the stuff in red

  6. #6
    Newbie
    Join Date
    April 10th, 2008
    Posts
    33
    What loxly says is correct: all Shareasale feeds have the same format.

    I don’t know anything about using these things with WordPress, but it looks to me like your sample row is missing the first column field (ProductID). That can throw the whole thing off.

    Name= Software
    MerchantID=47
    Merchant=Shareasale.com, etc

    Before ‘Sofware’, there should be ‘somenumber|’, just like before ‘Cubic Zirconia…’, there is ‘47035649|’.

    Those are not extra pipes at the end, they are normal – it’s just that some fields are populated in the “another merchant” sample that are not in the first sample row.

  7. #7
    Newbie spiritmonk's Avatar
    Join Date
    December 2nd, 2009
    Location
    Bangalored unfortunately
    Posts
    26
    Its been outdated long time ago and is not updated for a long time,that's the reason I developed my plugin for Shareasale datafeeds.

  8. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Chickens and Creative Problem Solving
    By writerguy in forum Virtual Family and Off-Topic
    Replies: 4
    Last Post: January 27th, 2011, 06:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •