RSS Post Tweet Help

Support / help / discussion forum for twitter bot
User avatar
martin@rootjazz
Site Admin
Posts: 23620
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

RSS Post Tweet Help

Post by martin@rootjazz » Mon Jun 29, 2015 7:30 pm

In order to setup custom RSS posting, you need to understand

XML
RSS
XPATH

Not a lot , but a little. When setting up your feed meta data in the program, you can see some standard values set, this should work for most feeds, but lets look at them to understand

So find your feed, and view the source, you will see it is probably structured

Code: Select all

<item>
....details of item1
</item>
<item>
....details of item2
</item>
etc
So we know, each item in the feed has the element

Code: Select all

<item>

It may also be

Code: Select all

<entry>
but usually <item>

Then we have

Code: Select all

<title>
<link>
<description>
All self explanatory. These can be used for the title / body / media link depending if you are posting a tweet / media link


Now images are a bit more complex, because not only do you want the above information, you also want the image URL. This is unlikely to be contained nicely in an element, so we need to scrape it from the page.
There are a few ways to do this

1) Using XPATH with an element (note you cannot use XPATH in an :encoded element

Code: Select all

<description/img[@id=''image_id_1379182']>
Another possibility is the value you want is an attribute of the RSS element, this can be accessed with the attribute code placed within brackets within the element specification

Code: Select all

<description[@src]>
2) Using the token [srclike=XXX], this means, if the element contains an image tag with a src attribute, we can get it without worrying about a complex xpath statement

so

<description>
...blah html blah <img src="http://twitterdub.wordpress.com/images/ ... 7490u3.jpg"> blah html
</descripion>

so we can use the token along with a pattern match like
[srclike=twitterdub.wordpress.com/images]

so our meta value is
<description>[srclike=twitterdub.wordpress.com/images]

Note this token does work with :encoded elements if your image is within an encoded tag this works fine:

<content:encoded>[srclike=XXX]




Similar helper functions are

<item>[json=XXX]
This will find the JSON value within the text of the XML element <item>. Where JSON format is
"name":"value"


<item>[urllike=XXX]
Similar to srclike, this will find the first URL to that contains the pattern XXX, so you can specify

<item>[urllike=rootjazz.com/videos]

and it will return the first URL within the text of <item> tag that contains a URL that contains rootjazz.com/videos, i.e.
https://rootjazz.com/videos/a-video-file.mp4





Another way to get at the image, is to scrape a path that is linked from the RSS feed using the token:
[scrapexpath=xpathtocontent]

Someone wanted to setup a post images from WORDPRESS feed, but the image URL wasn't included in the feed, but was on the wordpress page.

This is how to do it

goto POST IMAGES FROM RSS FEED

Click ASSIGN META

Click CUSTOM

Now we can leave
ITEM
TITLE
etc as the default, but you may want to change the description, your call.

But we will need to look at
IMAGE URL

The WORDPRESS FEED uses the element <LINK> to specify the page URL.

So we want to go to that URL then scrape the image URL

so we enter

Code: Select all

<link>[scrapexpath=xpathtocontent]
this means,
GOTO the URL noted by the <link>
Then scrape the page and use xpath to pull the image URL

e.g.

Code: Select all

<link>[scrapexpath=//meta[@property='og:image']/@content] 
where your xpath to the image is

Code: Select all

//meta[@property='og:image']/@content

Note we can still use the Rss element attribute notation if required (perhaps the URL link is not the element text but an attribute

Code: Select all

<link[@href]>[scrapexpath=//meta[@property='og:image']/@content] 
:-)

Jogurtfive
Posts: 58
Joined: Sun May 03, 2015 7:44 pm

Re: RSS Post Tweet Help

Post by Jogurtfive » Mon Jun 29, 2015 8:07 pm

can u explain us a bit why post rss to twiter ( example soudclud rss) . dont see what this feature is about?

User avatar
martin@rootjazz
Site Admin
Posts: 23620
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: RSS Post Tweet Help

Post by martin@rootjazz » Mon Jun 29, 2015 8:23 pm

Automatic posting.

Is a way to keep content fresh on your twitter.


depends what you are using twitter for really. Promoting your artist account is going have a different use case for those using it for SEO / affiliate marketing.

If you set up a tweet from youtube feed / channel / soundcloud / mixcloud etc, you can have automatically posted content that your followers (and potential followers may like) So your followers grow based on teh content you are adding. Then when you post your content you have a bigger base who see it

Jogurtfive
Posts: 58
Joined: Sun May 03, 2015 7:44 pm

Re: RSS Post Tweet Help

Post by Jogurtfive » Wed Jul 01, 2015 3:12 pm

thanks, all clear

janojebo
Posts: 226
Joined: Wed Nov 20, 2013 10:43 am

Re: RSS Post Tweet Help

Post by janojebo » Mon Dec 21, 2015 12:31 pm

Since i have no idea what im doing maybe im doing something wrong.
Here is what i want :
Post image from WP RSS with title and link to post.
So i managed to get posting image to twitter however both title and link is problem for me.
When i try only url it work fine
Image

Same with title

Image

But when i try both action fails see logs bellow.
Image

Code: Select all


Starting RSS Post: http://**/feed/
Found: 10 items, process using: 1 accounts
Posting with: 
Scraped image URL: http:///wp-content/uploads/2015/12/20.png
Saving Image: C:\Users\\AppData\Local\Temp\20_41.png
PostTweet :  using:
Posting: 1 images
Process image: C:\Users\\AppData\Local\Temp\20_41.png
Preprocess image: 20_41.png
Add image to tweet: 20_41.png
Added image to tweet: 20_41.png
Posting tweet: Brisa ♍
<link>[scrapexpath=//meta[@property='og:url']/@content]

RateLimiting check: 
* ERROR: Unauthorized -  Authentication credentials were missing or incorrect.
* ERROR Info: Could not authenticate you.
* FAILED: Posted RSS item: http:///wp-content/uploads/2015/12/20.png
Just paused for: 5 secs
Scraped image URL: http:///wp-content/uploads/2015/12/19.png
Saving Image: C:\Users\\AppData\Local\Temp\19_7.png
PostTweet :  using:
Posting: 1 images
Process image: C:\Users\\AppData\Local\Temp\19_7.png
Preprocess image: 19_7.png
Add image to tweet: 19_7.png
Added image to tweet: 19_7.png
Posting tweet: Shelby ♓
<link>[scrapexpath=//meta[@property='og:url']/@content]

RateLimiting check: 
* ERROR: Unauthorized -  Authentication credentials were missing or incorrect.
* ERROR Info: Could not authenticate you.
* FAILED: Posted RSS item: http:///wp-content/uploads/2015/12/19.png
Just paused for: 3 secs
* CANCEL REQUESTED
* CANCELLED
Cancel requested

So doing im something wrong? Need some close tag or something? Or is there token for link? Tried <title><link> but with no luck too.

User avatar
martin@rootjazz
Site Admin
Posts: 23620
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: RSS Post Tweet Help

Post by martin@rootjazz » Mon Dec 21, 2015 3:07 pm

You cannot put two element scrape tabs in a single box as you have done for description.

What are you trying to do?

You specified how to find the image, that should get posted.

Then in your description / tweet, you are posting the title as text which will appear below the image. Why are you enter the image scrape tag again?

Does your 2nd screenshot not work?

janojebo
Posts: 226
Joined: Wed Nov 20, 2013 10:43 am

Re: RSS Post Tweet Help

Post by janojebo » Mon Dec 21, 2015 3:18 pm

I want to post image from rss then in text area i want title and link to the post .
Its not the same is og:url this scrape the url of post.
1 and 2 works.
1 create image post with only link in text area
2 create image post with only title in text area
But when i try both then i get the error.

User avatar
martin@rootjazz
Site Admin
Posts: 23620
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: RSS Post Tweet Help

Post by martin@rootjazz » Mon Dec 21, 2015 6:49 pm

Still am not 100% sure I understand,

Can you send me the RSS file

then the values you want to be in the tweet body?

If is is private / or graphic, emails please

[code]support[at]rootjazz[dot]com[/code]


Am sure it is a simple answer, just not sure what you want to do

janojebo
Posts: 226
Joined: Wed Nov 20, 2013 10:43 am

Re: RSS Post Tweet Help

Post by janojebo » Tue Dec 22, 2015 12:37 pm

mail send

User avatar
martin@rootjazz
Site Admin
Posts: 23620
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: RSS Post Tweet Help

Post by martin@rootjazz » Wed Dec 23, 2015 1:00 am

as per the mail, it is not possible to enter a description that extracts two values from separate elements of the feed. Feature request to do so noted

Post Reply