May 4, 2011

Filter part within XML tag | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
Filter part within XML tag
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
June 13, 2022
12:54 pm
Avatar
B8europe
Member
Members
Forum Posts: 47
Member Since:
February 16, 2016
sp_UserOfflineSmall Offline

Anybody know how to filter out a part within a XML tag:

Login to see the code

only want:

Login to see the code

June 13, 2022
2:18 pm
Avatar
CyberSEO
Admin
Forum Posts: 3662
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Where this value is located? Do you store it in a variable or an an array? Can you post the actual XML feed URL?

For example, lets consider it’s stored as a custom field (e.g. “some_field”). In this case the following code will do the trick:

Login to see the code

June 13, 2022
3:59 pm
Avatar
B8europe
Member
Members
Forum Posts: 47
Member Since:
February 16, 2016
sp_UserOfflineSmall Offline

Login to see this link

June 13, 2022
5:25 pm
Avatar
CyberSEO
Admin
Forum Posts: 3662
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Use the code above and put this line into the “Custom fields” box:

downloads->some_field

 

or use this code:

Login to see the code

or.. somehow else, depending on your needs. In both cases the extracted video link will be stored in the “some_field” custom field, but you may put it wherever you want.

June 30, 2022
10:42 am
Avatar
B8europe
Member
Members
Forum Posts: 47
Member Since:
February 16, 2016
sp_UserOfflineSmall Offline

I have this code now

Login to see the code

However, only works sometimes at best

June 30, 2022
1:05 pm
Avatar
CyberSEO
Admin
Forum Posts: 3662
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

If the <downloads> tag is defined in your feed and it’s value starts with “http” and ends with “.mp4”, its value will be stored in the <video_url> custom filed. It won’t be stored there is <downloads> is not defined, if its value is empty or it’s not a link to a MP4 file (e.g. if that video file has a different file extension). It won’t happen “sometimes”. It works in 100% cases described above.

July 5, 2022
9:29 am
Avatar
B8europe
Member
Members
Forum Posts: 47
Member Since:
February 16, 2016
sp_UserOfflineSmall Offline

CyberSEO said
If the <downloads> tag is defined in your feed and it’s value starts with “http” and ends with “.mp4”, its value will be stored in the <video_url> custom filed. It won’t be stored there is <downloads> is not defined, if its value is empty or it’s not a link to a MP4 file (e.g. if that video file has a different file extension). It won’t happen “sometimes”. It works in 100% cases described above.  

Is it possible to make it conditional?

if <downloads> is “” not to parse the post and skip to the next one?

July 5, 2022
1:04 pm
Avatar
CyberSEO
Admin
Forum Posts: 3662
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Sure:

Login to see the code

There are examples in the manual: Login to see this link

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
11 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2625

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 4

Topics: 1527

Posts: 7724

Newest Members:

benjamin.david.banks, kravshenko, egeekbiz, ovidiu_balaban, atdotcom.email, info.soflamobi

Administrators: CyberSEO: 3662