Skip to content

Random Image from Folder

BrandonBrandon Reputation Management Pro
I've tried a couple different things such as:

%spinfolder_data_url-C:\Users\Administrator\Dropbox\SEO\Images%

How can I use the Insert Random > Own URLs feature to pull a random image from my folder?

Thanks!
«1

Comments

  • BrandonBrandon Reputation Management Pro
    @Sven do the pictures get uploaded to somewhere like picsearch.com? If so, I think I figured it out.
  • SvenSven www.GSA-Online.de
    no, that image is encoded in base64 and posted to the page directly.
  • BrandonBrandon Reputation Management Pro
    @sven So what would be the correct way to embed an image from a folder? What code should I put in the box?

    %random_image-C:\Users\Administrator\Dropbox\SEO\Images%

    I tried that and got some images, but they were all hosted at picsearch not the domain.
  • SvenSven www.GSA-Online.de

    The macro %random_image% uses the providers configured in content_search.dat.

    If it's a fixed place you want to have the images in, then you need to use...

    <img src="%spinfolder_data_url-C:\Users\Administrator\Dropbox\SEO\Images%" />

    If it should be a random place, you can put the folder/images in "Own URLs" box when enabling the option in article manager to insert random images.

  • BrandonBrandon Reputation Management Pro
    edited May 2014
    Hey @Sven, would you mind answering one more?

    I want to pull a random image from a folder. I have tried the following and none would work.

    • <img src="%spinfolder_data_url-C:\Users\Administrator\Dropbox\SEO\Images%" />
    • %spinfolder_data_url-C:\Users\Administrator\Dropbox\SEO\Images%
    • C:\Users\Administrator\Dropbox\SEO\Images
    • %random_image-C:\Users\Administrator\Dropbox\SEO\Images%

    I put only 1 image in the Images folder so I would know when it was posted, but I can't seem to get it to publish that particular image.
  • SvenSven www.GSA-Online.de
    The first one is correct. But keep in mind that not all engines will allow a data url as content.
  • BrandonBrandon Reputation Management Pro
    Thanks @Sven, working now!
  • BrandonBrandon Reputation Management Pro
    One more followup, for Profile Image, what code is used to select a random image from the same folder? #2 gave me broken links, #4 was rejected. #3 can't be used because it wants to chose an actual file.
  • SvenSven www.GSA-Online.de
    Just use %spinfolder% macro there.
  • BrandonBrandon Reputation Management Pro
    @Sven, I used %spinfolder-C:\Users\Administrator\Dropbox\SEO\Images% and it tried, but broke many of the pages.

    When the image was to be inserted, nothing was inserted and the content below it wasn't posted. I can send you the backup if you want to take a look.
  • SvenSven www.GSA-Online.de
    hmm I use the same thing on my project and it works just fine. However sned the project backup and some details on where it went wrong.
  • DzilRelDzilRel ____'s Backyard
    When the image is encoded, does the name change? I am not sure if I should workout a way to automatically rename files for each keyword market, or just make them 001 002 003.
  • DzilRelDzilRel ____'s Backyard
    And one more, where do I find instructions on how to insert my own images folder in articles in a random position?
  • SvenSven www.GSA-Online.de

    The name does not matter if the image is encoded and in html.

    ou just use the "Own URLs" checkbox and put the macro there or the file names.

  • BrandonBrandon Reputation Management Pro
    Hey @Sven, just to be clear, can you give us the macro for selecting a random image from a folder please?
  • SvenSven www.GSA-Online.de
    %spinfolder%
  • BrandonBrandon Reputation Management Pro
    I'll try it out:

    %spinfolder-C:\Users\Administrator\Dropbox\SEO\Images%
  • BrandonBrandon Reputation Management Pro
    @Sven, Can you give me an example platform that will post images. I tried all articles and looked through a lot of verifieds and can't find any images. I want to make sure my settings are right, but need to know which engine to test. I thought XpressEngine posted images, but can't see any after building 150 pages.
  • BrandonBrandon Reputation Management Pro
    I have seen a couple of broken images. When I right click and copy image location I get this:

    image
  • SvenSven www.GSA-Online.de
    well thats the image itself encoded in base64 ... all ok...there is no image location.
  • BrandonBrandon Reputation Management Pro
    @Sven what do you mean? The images are all jpg.
  • BrandonBrandon Reputation Management Pro
    @Sven, just noticed that images work when I do NOT check "Use Own URLs". So a randomly selected image works, but mine break. Same domain.
  • SvenSven www.GSA-Online.de
    is that image actually ok?
  • BrandonBrandon Reputation Management Pro
    I can see the images in my folder.

    When I post a randomly selected image (not using my URLs, but your random web selection) it works.

    When I check Use Own URLs, the image shows broken online. I PM'ed you examples of working (random from online), and non-working (random from my folder).
  • SvenSven www.GSA-Online.de

    ok next version will fix it ... I think you image might have a spin syntax in it that is removed. Thats of course not something you want. Till next version just add the file names to the box. that should work.

  • BrandonBrandon Reputation Management Pro
    @Sven, thanks. So I can only use a single URL until the next version, correct?
  • SvenSven www.GSA-Online.de
    no, also imaged from folder. you an also add the folder path itself ... i think SER will pick an image from it by default anyway.
  • BrandonBrandon Reputation Management Pro
    Tried just the path and that didn't work. Most of the time it broke the whole page, and the content stopped at the image.

    image
  • SvenSven www.GSA-Online.de
    ok will make it working on next release.
  • BrandonBrandon Reputation Management Pro
    @Sven, I found an image on one post! Getting better! I'm still seeing a lot of encoded/broken images and a lot of places it looks like it's trying to put an image, but it's not happening.

    image
    image
    image

    That extra space between the paragraphs is where the image is supposed to show I believe. Most of those are in XpressEngine and a couple of others.
Sign In or Register to comment.