• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » Wordpress » Free Amazon Asin Grabber Plugin and Tutorial

Free Amazon Asin Grabber Plugin and Tutorial

By Sigit Prasetya Nugroho ∙ August 28, 2014 ∙ Wordpress ∙ 9 Comments

Share : TwitterFacebookTelegramWhatsapp

Previously I made an article about Quickly Build Amazon ASIN Grabber with Simple Html DOM , For easy to use, I created this script into the WordPress plugin. With this plugin, you have your amazon asin grabber. Besides giving this plugin to you for free, i share tutorial how to build Amazon Asin Grabber as wordpress plugin  too :).

Okay, we lets start asin grabber tutorial 🙂 (NOTE : This is my first wordpress plugin 🙂 )

Table of Contents

  • 1 Build Amazon Asin Grabber WordPress Plugin
    • 1.1 Create WordPress Plugin Header
    • 1.2 Create new add_action function
    • 1.3 Create Asin Grabber function
    • 1.4 Create  asin_back() function
    • 1.5 Create graburl() function
  • 2 Download amazon asin grabber WordPress Plugin

Build Amazon Asin Grabber WordPress Plugin

Free Amazon Asin Grabber as WordPress Plugin

Create WordPress Plugin Header

To create WordPress plugin, we need to create Standard Plugin Information header. This header lets the WordPress recognize if your plugin is exists, add the code below to the main plugin file.

Without the plugin header, your plugin will never be activated and running ( Read more how to create wordpress plugin here wordpress.org ). Create new php file, give name as asin-grabber.php

1
2
3
4
5
6
7
8
/*
Plugin Name: Amazon Asin Grabber
Plugin URI: https://seegatesite.com
Description: With Amazon Asin Grabber plugin, you can grab unlimited Amazon Asin Code. Make sure your hosting powerful, before you grab thousands of ASIN :)
Version: 1.0
Author: Sigit prasetya nugroho
Author URI: https://seegatesite.com/
*/

Create new add_action function

Add add_action function to locate your plugin’s menu

1
2
3
4
add_action('admin_menu', 'lokasi_menu');
function lokasi_menu(){
add_options_page('Amazon ASIN Grabber', 'Amazon ASIN Grabber', 'manage_options', 'asin-grab', 'asin_grabber_func');
}

  • admin_menu is the name of add_action.
  • lokasi_menu is my add_action value.
  • To put location of plugins in the settings menu we need a function add_options_page.

Create Asin Grabber function

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
function asin_grabber_func()
{
if (isset($_POST['submit']))
{
if(!empty($_POST['asin_txt']) && !empty($_POST['page']) )
{
if (filter_var($_POST['asin_txt'], FILTER_VALIDATE_URL) === FALSE) {
?>
<button onclick="history.go(-1);">Back </button><br />
<?php
die('Not a valid URL Address');
}
$hasil=graburl(urlencode($_POST['asin_txt']),$_POST['page']);
echo $hasil;
}else
{
?>
<button onclick="history.go(-1);">Back </button><br />
<?php
die('Please fill URL Address or Page count');
}
}
else
{ ?>
    <div class="wrap">
<form method="post" action="<?php echo asin_back();?>">
<h2>Amazon Asin Grabber</h2>
    <table>
   <tr>
         <td>Url</td>
            <td> : <input type="text" id="asin_txt" name="asin_txt" placeholder="Example : http://www.amazon.com/s?keywords=iphone" size="100" /></td>
        </tr>
        <tr>
         <td>Page</td>
            <td> : <input type="text" size="3" id="page" name="page" value="10" /></td>
        </tr>
   <tr>
         <td><input type="submit" name="submit" id="submit"></td>
        </tr>
    </table>
  </form></div>
<?php }

We create HTML Form in asin_grabber_func(), we need 2 parameters to grab asin from amazon (amazon url and page count).

1
action="&lt;?php echo asin_back();?&gt;"

Create  asin_back() function

1
2
3
function asin_back(){
return admin_url("options-general.php?page=asin-grab");
}

Create graburl() function

garburl() function used to grab asin.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function graburl($url,$page)
{
$html = file_get_html(trim(urldecode($url)));
$retval='';
$no=1;
$asin_area='';
$cnt=0;
foreach($html->find('a') as $element)
{
   foreach ($element->find('span') as $node1)
   {
   if ($node1->class=='lrg bold')
   {
   foreach ($node1->find('text') as $node)
   {
if ($node->parent() === $node1 && strlen($t = trim($node->plaintext)))
{
$url = $element->href;
$hasil=explode("/",$url);
if (count($hasil)>=5)
{
if ($hasil[4]=='dp')
{
$asin_area=$asin_area.$hasil[5]."\n";
$asin=$hasil[5];
$cnt++;
}
}
$no++;
}
  }
}
   }
}
$retval='<h2>Result : </h2><table><tr><td>Grab :</td><td>'.$cnt.' Asin</td></tr><tr><td colspan=2><textarea style="float:left;" rows="20" cols="12">'.$asin_area.'</textarea></td></tr></table><button onclick="history.go(-1);">Grab More </button><br/> * If you need tutorial how to create this plugin visit my site <a href="https://seegatesite.com" target="_blank">Seegatesite</a>';
return $retval;
}

Voila, Your asin grabber plugin has been created 🙂

Download amazon asin grabber WordPress Plugin

If you need to download example amazon asin grabber , click link below 

asin-grabber 

.

or download here https://wordpress.org/plugins/amazon-asin-grabber/

Another WordPress Related Post :

  • How To Create The Fastest Social Share Button WordPress Without Plugin
  • Create WordPress Slider Without Javascript
  • The Point Responsive WordPress Theme For Blogging
  • The Doctors Free WordPress Responsive Theme For Medical
  • Develop Your Site With Start Blogging The Responsive WordPress Theme
  • Zerius Theme The Free WordPress Responsive Theme

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Comments

  1. Avatar for MikeMike says

    October 3, 2014 at 1:12 pm

    Nice! Thanks for this addon..

    One thing.. when I tried.. If I ask 10 page.. no problem.. But if I ask 50 or more.. I get no result.. Page come empty.. Probably something about a too long request.. I think an option “how many page per request” should be needed..

    Reply
    • Avatar for Sigit Prasetya NugrohoSigit Prasetya Nugroho says

      October 3, 2014 at 4:21 pm

      Hello mike, Thank you very much for your response and great request.. i will update my plugin as soon as as soon as possible 🙂

      Reply
  2. Avatar for jitendrajitendra says

    November 4, 2014 at 10:08 am

    whenever i enter url and click submit it gives me 404 error

    Reply
    • Avatar for Sigit Prasetya NugrohoSigit Prasetya Nugroho says

      November 5, 2014 at 1:56 am

      hello,
      Can you give a more detailed explanation?
      thx you 🙂

      Reply
  3. Avatar for NoorNoor says

    November 28, 2014 at 4:44 am

    Hey Sigit,
    Great resources for building API based plugins on your site.
    I wanted to know if its easy to implement outputting product titles along with its corresponding ASIN numbers (e.g. AB14324242 —> Apple iPhone).

    Also, how easy or difficult would be to create an application like this?
    hxxp://www.youtube.com/watch?v=mMBxbUAjUiE&list=UUruB4Z6HL5Ys6-AIkfYOgvA

    Reply
    • Avatar for Sigit Prasetya NugrohoSigit Prasetya Nugroho says

      November 29, 2014 at 8:37 am

      Check this https://seegatesite.com/quickly-build-amazon-asin-grabber-with-simple-html-dom/
      if you need to grab asin with title 🙂

      Reply
  4. Avatar for sagarsagar says

    October 12, 2015 at 4:31 pm

    hi,

    with ASIN grabber all when ASIN get grabbed and when we put to CSV bulk import the products get imported but not all the variations. why it is so??
    Is there any method to grab only parent ASINs because only variations are coming with the parent ASINs

    Reply
    • Avatar for Sigit Prasetya NugrohoSigit Prasetya Nugroho says

      October 15, 2015 at 1:50 pm

      Sory, i can’t do that 🙂

      Reply
  5. Avatar for 360marketbazar360marketbazar says

    May 13, 2020 at 2:51 pm

    I Want Amazon Grabbing Tools for making Affiliate Webs Site.
    If You Have Please Send Me Demo Link.

    Reply
    • Avatar for Sigit Prasetya NugrohoSigit Prasetya Nugroho says

      May 14, 2020 at 3:08 am

      hello, sorry I haven’t used amazon in a while … so the script wasn’t updated.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (7) Publisher Tips (5) react (3) Reactjs (7) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) widget (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2021 Seegatesite.com