[deleted]
katos with a bit of modification, yes. You could create an associate array that defines the tag for each feed. I've been thinking about doing this myself as my forum evolves, so yes, it's certainly possible
katos with a bit of modification, yes. You could create an associate array that defines the tag for each feed. I've been thinking about doing this myself as my forum evolves, so yes, it's certainly possible
JAC eventually, yes. No time frame yet though.
[deleted] this is cool .. Thanks in Advance
Hi [deleted],
I have everything working with the feed DB, but nothing is posted to flarum.
When I run php rssparser.php
For each, out of the 10 items I get;
This does not exist...processing Checking https://articleURL/ This does not exist...processing
When I run php rssparser.php
again For each, out of the 10 items I get;
Checking https://articleURL/ This has already been processed...skipping
When I check the feed DB, the id | url | title | seen
content are there correctly.
But, nothing is posted to flarum.
Instructions I followed
$header = array(
"Authorization: Token the token you generated in the first step",
"Content-Type: application/json"
);
I changed "Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
In my flarum_api_keys table I have;
key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
id = 1
allowed_ips = NULL
scopes = NULL
user_id = I used "NULL" and I used the "userID"
created_at = 0000-00-00 00:00:00
last_activity_at = NULL
array(
'type' => 'tags',
'id' => "23"
)
` I changed 23 to the primary tag, (and even checked to make sure my tag settings is; Required Number of Primary Tags =1, Required Number of Secondary Tags =0)
curl_setopt($ch, CURLOPT_POST, 22);
- I changed 22 to the user ID and gave the user admin rights.
Please what am I missing @[deleted] . Thanks in advance...
Operator Did you install the flarum api client at the top of the guide, and create a key in the database ?
Is CURL installed on your system ?
Also, are you sure that the tag ID is correct ? The API is verbose, so should post some output as to why it didn't work. Can you set $items = 10;
to $items = 1;
then empty the feed table (truncate, not drop).
Run rssparser.php
again and post the output
Thank you for replying...
Yes CURL is installed.
When I applied your instructions, I got
Connected to database Processing RSS feed https://articleURL/ This does not exist...processing
Checking the feed DB, the id | url | title | seen
are there
But, again nothing in flarum
I know this sounds stupid (and it's my fault for not getting it right in the documentation) but within rssparser.php, can you ensure that you are referencing "details.php" using the correct path, and not as below ?
include("/var/www/vhosts/phenomlab.com/details.php");
It should be
include("/path/to/your/details.php");
Failing that, I will need some form of access to your environment to review this.
Operator Did you set this ?
curl_setopt($ch, CURLOPT_URL, 'https://yourflarumurl/api/discussions');
[deleted] Yes I when used curl_setopt($ch, CURLOPT_URL, 'https://yourflarumurl/api/discussions');
I got a csrf_token_mismatch 400
error
Connected to database Processing RSS feed https://articleURL/ This does not exist...processing {"errors":[{"status":"400","code":"csrf_token_mismatch"}]}
So, i changed it to curl_setopt($ch, CURLOPT_URL, 'api/discussions');
since I am running the script from root which clears the csrf_token_mismatch 400
error
But, could my alteration have been the reason why flarum api is'nt taking in the request.?
But, could my alteration have been the reason why flarum api is'nt taking in the request.?
Yes
You need the full URL for the API to work - can you set that and try again ? For example https://www.myforum.com/api/discussions
Okay, Changed it. But, now i am stuck with this error;
Connected to database Processing RSS feed https://articleURL/ This does not exist...processing {"errors":[{"status":"400","code":"csrf_token_mismatch"}]}
Operator Are you running Beta13 ? That bug was resolved in this release.
Operator Hmmm... Any caching taking place, for example, NGINX etc ?
Operator Let's take this offline to Discord. You can easily find me there I have some questions which require answers but obviously not for posting here for security reasons.