[wp-hackers] automatic image importing

Abdussamad Abdurrazzaq abdussamad at abdussamad.com
Sun Sep 23 10:28:20 UTC 2012


There are some functions in wp-admin/includes/file.php and media.php 
that you can use:

download_url() to download the file
media_handle_sideload() to add the file to media library

Then wp_insert_post to add a new post with wp_get_attachment_link() as 
the content.

On 09/23/2012 09:29 AM, Dmitry Tokmakov wrote:
> Hi all!
>
>
> Here is my problem:
>
> I'm reading json feed that contain image urls from direct server.
>
> I'm looking for solution to download every image from that feed into my
> wordpress library on my server and create a new post for every image and
> set all image as attachments - one image per post.
>
> I need to do it programmatically and check that feed for new images every
> 10 minutes (I will need cron for that I guess)
>
>
> I wonder if anyone has experience with automatic image importing From
> server to server...
>
>
>
> Thank you in advance!
>
>
> Dmitry
>
> Moxie Media Group
>
> getmoxied.net
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>




More information about the wp-hackers mailing list