const ProductHuntData = {};

ProductHuntData.request = null;

ProductHuntData.config = (config) => {
    ProductHuntData.request = config.request;
};

ProductHuntData.getItems = (callback) => {
    const baseUrl = 'https://api.producthunt.com/v1';

    ProductHuntData.request
        .get(baseUrl+'/posts')
        .set('Authorization', 'Bearer bbb38245895a24cf4a2546fa2a96a20fa8bec59badc1a327acd3b5afe449b73f')
        .end((error, response) => {
            let data = [];
            for (let product of response.body.posts) {
                data.push({
                    id:            product.id,
                    name:          product.name,
                    tagline:       product.tagline,
                    url:           product.redirect_url,
                    votesCount:    product.votes_count,
                    commentsCount: product.comments_count,
                    discussionUrl: product.discussion_url,
                });
            }
            callback(data);
        });
};

export default ProductHuntData;

@@ -220,196 +220,158 @@
 s://
-api.producthunt.com/v1';%0A%0A    ProductHuntData.request%0A        .get(baseUrl+'/posts')%0A        .set('Authorization', 'Bearer bbb38245895a24cf4a2546fa2a96a20fa8bec59badc1a327acd3b5afe449b73f'
+wrapapi.com/use/sunnysingh/producthunt/todaytech/0.0.2?wrapAPIKey=vZpCx0QXD65gAcUD4Q7gAL6y0GQB1pgT';%0A%0A    ProductHuntData.request%0A        .get(baseUrl
 )%0A  
@@ -477,16 +477,21 @@
 se.body.
+data.
 posts) %7B
@@ -691,16 +691,1027 @@
     url:
+           'https://www.producthunt.com'+product.shortened_url,%0A                    votesCount:    product.vote_count,%0A                    commentsCount: product.comment_count,%0A                    discussionUrl: 'https://www.producthunt.com'+product.url,%0A                %7D);%0A            %7D%0A            callback(data);%0A        %7D);%0A%7D;%0A%0A// Directly using Product Hunt API. Issues on Safari.%0A//%0A// ProductHuntData.getItems = (callback) =%3E %7B%0A//     const baseUrl = 'https://api.producthunt.com/v1';%0A//%0A//     ProductHuntData.request%0A//         .get(baseUrl+'/posts')%0A//         .set('Authorization', 'Bearer bbb38245895a24cf4a2546fa2a96a20fa8bec59badc1a327acd3b5afe449b73f')%0A//         .end((error, response) =%3E %7B%0A//             let data = %5B%5D;%0A//             for (let product of response.body.posts) %7B%0A//                 data.push(%7B%0A//                     id:            product.id,%0A//                     name:          product.name,%0A//                     tagline:       product.tagline,%0A//                     url:
         
@@ -1731,24 +1731,27 @@
 direct_url,%0A
+// 
             
@@ -1786,32 +1786,35 @@
 ct.votes_count,%0A
+// 
                 
@@ -1848,32 +1848,34 @@
 comments_count,%0A
+//
                 
@@ -1870,32 +1870,33 @@
                 
+ 
 discussionUrl: p
@@ -1914,24 +1914,27 @@
 ussion_url,%0A
+// 
             
@@ -1933,32 +1933,35 @@
             %7D);%0A
+// 
             %7D%0A  
@@ -1950,32 +1950,35 @@
 /             %7D%0A
+// 
             call
@@ -1981,32 +1981,35 @@
 callback(data);%0A
+// 
         %7D);%0A%7D;%0A%0A
@@ -2000,24 +2000,27 @@
         %7D);%0A
+// 
 %7D;%0A%0Aexport d

Fix issue #2 where PH wouldn't work on Safari