Search

Hi! Push me in the right way, but don't know, maybe it's impossible, maybe it's simple...i'm not a good coder)

Well, i have:

-Dynamic DS "vk audio" with ds url:

https://api.vk.com/method/audio.search.xml?q={$audio-title}&access_token={$token}

-Entries with audio content

-In audio section input field audio-title

i want send this param to my ds url, but on main page 5 entries with audio content, and i'm confused: how to connect multiple dynamic ds? is it possible?

Thanks!

Hi Chieko,

From my understanding you are trying to connect to vKontakte to do a search.

I am not a vKontakte expert but first of all I think you have to make sure you have the valid token using oAuth I presume from your structure it is 2.0 then you would have to output your Token as a param, either by a datasource or else through an event or some extension. Similarly with the audio-title.

The above url structure would work as long as you have the token and the audio-title set.

Additionally the version of Symphony you are using would be helpful. As I am working on something oAuth compatible for 2.3 which you might find useful.

gunglien, yeah, i know about what you're talking. I trying to get URL for audiofiles in my blog, vk.com gigantic storage with music, but url for files depend at IP adreess, and so I decided parse this xml.

I define $token in "vk audio" ds:

$token='ACCESS_TOKEN_KEY';
$this->dsParamURL .= $token;

My xml output looks like this(e.g.)

<audio>
<aid>82930247</aid>
<owner_id>1491708</owner_id>
<artist>Actress</artist>
<title>Maze</title>
<duration>321</duration>
<url>http://cs4842.vkontakte.ru/u1491708/audio/2f4ccaa60560.mp3</url>
</audio>
<audio>
<aid>81154347</aid>
<owner_id>3058243</owner_id>
<artist>Actress</artist>
<title>Maze (My Dry Wet Mess Remix)</title>
<duration>329</duration>
<url>http://cs5011.vkontakte.ru/u3058243/audio/8ccfe0b63295.mp3</url>
</audio>

And ok, i get audio-title on my page output, but how send this value to ds-url, and how if there several audio-title on this page? My symphony version is 2.3

Hmm if it was me I would output the token in the parampool.

assume you are already customizing your DS so you would add - $param_pool['token'] = $token. However I am not sure from where you get audio-title. Is this from the URL itself or is it from the XML?

If from an XML feed you would need to have an extension that hooks to DataSourcePostExecute more info in the delegates API page

PS I am not sure if the token you are using is per-client if so you have to make sure that this is valid. As tokens might expire or be otherwise invalidated.

Hmm if it was me I would output the token in the parampool.

probably yes, is it correct, i not understand datasource source code, might be better to leave it. So far it is difficult for me, mainly due to problems with language skills :(

Now i try embeded soundcloud player, but got stuck again at the same moment.

It's my audio utility - http://xpathr.com/view/2874988/

I need to get $track_id, but before need to create dynamic ds with url and attach to page:

http://api.soundcloud.com/resolve?client_id=MYTOKEN&amp;format=xml&amp;url=SOUNDCLOUD_URL

SOUNDCLOUD_URL need to be $audio-source in my utility to get xml data, then set variable $track_id from this xml. It is needs exstension?

sorry for my terrible english

Chieko, not sure if you are not clear enough or you didn't grasp symphony yet.

you would need to pass SOUNDCLOUD_URL to your dynamic datasource by using the param-pool. Either through another datasource - where you write this or in another way. Unless you know soundcloud url from before.

To set the $track_id I am afraid you would have to set an extension if you are using a remote/dynamic datasource. As I don't think they support parameter output yet. Usually it would be of the form ds-mydatasource or ds-mydatasource.track_id so then you could include this in other data-sources.

with your help slowly beginning to understand)

i create two ds, soundcloud-url from my audio section with output parameter $ds-souncloud-url.audio-source and limit "1"

and Dynamic XML "soundcloud" with url:

http://api.soundcloud.com/resolve?client_id=mytoken&format=xml&url={$ds-soundcloud-url}

then attach this DS'es to my entries page and home page, add to my utility this:

    <xsl:param name="track_id" select="/data/soundcloud/id"/>       

yeah, it's works, but some problems:

I have in output only one ds parameter and only the last, but on my home page few entries and i see on each entry identical audios.

Ahh what you want then is an Array of audio-source right?

and then you choose the right audio-source for each item? Might be a bit more complex if I understand correctly because the approach you are taking only works for 1 soundcloud-url

not quite... my xml output on homepage: http://xpathr.com/view/2884488/

audio-source->ds-soundcloud-url->soundcloud and i get ID of audio

for each item() need own ID audio

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details