1. andrejk
  2. RO CSVI
  3. Tuesday, 07 January 2025
  4.  Subscribe via email
Hello,

please, I have 38 feeds. Feeds have the same structure. I can make one tamplate and then in crone call in a loop something like:


$command_CSV_Import_Parent = "/var/www/ppp/test.sk/web/cli/; /usr/lib64/php8.0/bin/php /var/www/ppp/test.sk/web/cli/joomla.php -vv rocsvi:import --template_id=1 --key=KMJNU78JH --file="https://www.example1.sk/feed1.xml" ";


In each cycle I just change the file variable and insert another feed url. Is this possible please? Or do I need to make 38 templates?

Translated with DeepL.com (free version)

Best regards
Andrej
Accepted Answer Pending Moderation
Hello RolandD,

ok, I'll try it,
thank you!


Best regards
Andrej
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
HI Andrej,

yes, but is it possible to change the url of feeds in a cycle?
You will need to write a bash script that does this for you. Here is an example to get you started. You would then schedule the bash file as cron command.

Let me know if that helps.


#!/bin/bash

# List of URLs
urls=("http://example1.com" "http://example2.com" "http://example3.com")

# Command template
command_template="my_command --url %s"

# Loop through each URL and construct the command
for url in "${urls[@]}"; do
full_command=$(printf "$command_template" "$url")
echo $full_command
done
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Andrej,
is it possible to change the url with --file="https://www.example1.sk/feed1.xml"?

As of now this is not possible but we have added this feature to our todo list and we will include it in future RO CSVI release.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello Tharuna,

yes, but is it possible to change the url of feeds in a cycle? We will start the import via cron.

is it possible to change the url with --file="https://www.example1.sk/feed1.xml"?

Best regards

Andrej
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Andrej,
In each cycle I just change the file variable and insert another feed url. Is this possible please? Or do I need to make 38 templates?

If the fields you import are the same you can use same template for all 38 files. You can just change the feed URL for each import.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!