Sign in to follow this  
Followers 0
7121

HyperMachine [Website] Virtual Click Play

2 posts in this topic

#1 ·  Posted (edited)

PLEASE DELETE THIS POST IF YOU LIKE MODERATOR. I can't seem to get some of this editing functions to work.

Hey guys, I need help with just a quick technical task for the firefox UDF. Basically i want to make a macro that can play music simulating a click. I am aware there is a client for this website but it costs, and where's the learning in that. Anyway, i know how to use the firefox UDF, sorta but the problem i have come to is sending the proper command.

I know for sure it is super easy to do but I do not know my web langauges such as javascript or html too well, which is the problem i'm having. I don't know how to simulate a click on that object (which is the play button) for that certain song.

How the program works:

It'll read the source, and with heavy string operations, it'll array the first couple of songs or probably all 50 for that certain week. After that, i'll make it list the songs and it'll enable me to choose which one to click play. I guess you can say i'm trying to come up with my HyperMachine client but it's more focused on the browser.

Here is a sample chunk from the source:

<div data-itemid="[url=""]1q9jr[/url]" id="[url=""]section-track-1q9jr[/url]" class="[url=""]section section-track odd[/url]" >
<div class="[url=""]track-info[/url]"> </div>

<div class="[url=""]section-player[/url]">

<span class="[url=""]share-links[/url]">
<a class="[url=""]facebook-share fire-share-modal[/url]" data-href="[url=""]/share.php?s_provider=awesm&share_type=facebook&create_type=hypem-player&url=http%3A%2F%2Fhypem.com%2Fitem%2F1q9jr&title=Wild+Belle+-+It%27s+Too+Late+%28Snakehips+Remix%29[/url]"><img src="[url="view-source:http://hypem.com/images/icon-fb-share.gif"]/images/icon-fb-share.gif[/url]" /> Share</a>
<a class="[url=""]twitter-share fire-share-modal[/url]" data-href="[url=""]/share.php?s_provider=awesm&share_type=twitter&create_type=hypem-player&url=http%3A%2F%2Fhypem.com%2Fitem%2F1q9jr&text=Wild+Belle+-+It%27s+Too+Late+%28Snakehips+Remix%29%20on%20@hypem&via=hypem[/url]"></a>
</span>

    <span class="[url=""]rank[/url]">2</span>

<script type="[url=""]text/javascript[/url]">
day_points['1q9jr'] = [2,2,8,5,3,3,5,5,4,5,14,18];
</script>
<a data-post-id="[url=""]1q9jr[/url]" class="[url=""]sparkdiv[/url]" onclick="[url=""]toggle_item_graph('1q9jr'); return false;[/url]">
<div id="[url=""]sparkline-1q9jr[/url]"></div>
</a>



<a class="[url=""]thumb[/url]"
href="[url="view-source:http://hypem.com/track/1q9jr/Wild+Belle+-+It%27s+Too+Late+%28Snakehips+Remix%29"]/track/1q9jr/Wild+Belle+-+It%27s+Too+Late+%28Snakehips+Remix%29[/url]"
title="[url=""]It's Too Late (Snakehips Remix) - go to page for this track[/url]"
style="[url=""]background:url(http://static-ak.hypem.net/thumbs_new/1f/2002975.png);[/url]">
</a>

<h3 class="[url=""]track_name[/url]">
    <span class="[url=""]remix-icon[/url]"></span>
<a class="[url=""]artist[/url]" title="[url=""]Wild Belle - search hype machine for this artist[/url]" href="[url="view-source:http://hypem.com/artist/Wild+Belle"]/artist/Wild+Belle[/url]">Wild Belle</a> -   <a class="[url=""]track[/url]" title="[url=""]It's Too Late (Snakehips Remix) - go to page for this track[/url]" href="[url="view-source:http://hypem.com/track/1q9jr/Wild+Belle+-+It%27s+Too+Late+%28Snakehips+Remix%29"]/track/1q9jr/Wild+Belle+-+It%27s+Too+Late+%28Snakehips+Remix%29[/url]">
    <span class="[url=""]base-title[/url]">It's Too Late</span> <span class="[url=""]remix-link[/url]">Snakehips Remix</span> </a>
    


    
</h3>




<ul class="[url=""]tools[/url]">
     <li class="[url=""]playdiv[/url]">
<a id="[url=""]play_ctrl_1q9jr[/url]" class="[url=""]play-ctrl play[/url]"
title="[url=""]Play[/url]"
href="">Play<span></span>
</a>
</li>
    
     <li class="[url=""]favdiv[/url]">

                
<a class="[url=""]fav_item_1q9jr fav-off[/url]"
id="[url=""]fav_item_1q9jr[/url]"
onclick="[url=""]toggle_favorite('item','1q9jr');return false;[/url]"
title = "[url=""]Favorite[/url]"
href="">Favorite<span></span>
</a>
</li>



</ul>
    
<div class="[url=""]meta[/url]">
<span class="[url=""]buy[/url]">
<a href="" class="[url=""]toggle-reposts[/url]">
Posted by
9 blogs</a> &bull;

Download Artist:
<a rel="[url=""]nofollow[/url]" href="[url="view-source:http://hypem.com/go/emusic_search/Wild+Belle"]/go/emusic_search/Wild+Belle[/url]">eMusic (<strong>$10 FREE</strong>)</a> &bull;
<a rel="[url=""]nofollow[/url]" href="[url="view-source:http://hypem.com/go/amazon_mp3_search/Wild+Belle"]/go/amazon_mp3_search/Wild+Belle[/url]">Amazon</a>
</span>
</div>


<p>
<a
class="[url=""]blog-fav-off[/url]"
title="[url=""]See other tracks posted by this blog[/url]"
href="[url="view-source:http://hypem.com/blog/les+petits+bruits/18064"]/blog/les+petits+bruits/18064[/url]">Les Petits Bruits</a><a class="[url=""]follow-pill fav_site_18064 follow[/url]"
onclick="[url=""]toggle_favorite('site','18064');return false;[/url]"
href="[url="view-source:http://hypem.com/popular#"]#[/url]"><em></em><span>Follow</span></a>

    &ldquo;Crédit photo : Mike et Doug Starn Un remix galactique, interstellaire, exceptionnel que nous offre ici SnakeHips. C'est à la&hellip;&rdquo;        <a
class="[url=""]readpost[/url]"
href="[url="view-source:http://www.lespetitsbruits.fr/2012/10/wild-belle-its-too-late-snakehips-remix.html"]http://www.lespetitsbruits.fr/2012/10/wild-belle-its-too-late-snakehips-remix.html[/url]"
title="[url=""]2:01 PM - 4 Oct 12 CST[/url]">

First posted on Oct 4th&nbsp;&raquo;

<span style="[url=""]background:url(http://static-ak.hypem.net/thumbs_new/1f/2002975.png);[/url]"></span>
</a>

</p>




    <div class="[url=""]act_info[/url]" style="[url=""]display:none[/url]"></div>


<!-- SHOW MAIN FLOT -->
<div id="[url=""]flot-1q9jr-container[/url]"></div>


</div><!-- section player -->
</div><!-- section track -->

This is the part that I am trying to click on, the play button itself.

<ul class="[url=""]tools[/url]">
     <li class="[url=""]playdiv[/url]">
<a id="[url=""]play_ctrl_1q9jr[/url]" class="[url=""]play-ctrl play[/url]"
title="[url=""]Play[/url]"
href="">Play<span></span>
</a>
</li>
    
     <li class="[url=""]favdiv[/url]">

                
<a class="[url=""]fav_item_1q9jr fav-off[/url]"
id="[url=""]fav_item_1q9jr[/url]"
onclick="[url=""]toggle_favorite('item','1q9jr');return false;[/url]"
title = "[url=""]Favorite[/url]"
href="">Favorite<span></span>
</a>
</li>



</ul>

So yeah, that's about it, how may i go about doing this? Samples perhaps? I guess i should try and execute some samples of my own but i thought i post first incase things don't work out.

================================================================================================

I'm gonna answer my own solution. LOL.

The command is:

$sObj = _FFXpath("//a[@id='play_ctrl_"INSERT SONG ID HERE" ']","",9)

_FFClick($sObj)

Edited by 7121

Share this post


Link to post
Share on other sites



This will start the first song playing:

#Include <FF.au3>

If _FFConnect() Then
_FFOpenURL('http://hypem.com/popular')

$sObj = _FFXpath("//a[@class='play-ctrl play']","",9)

_FFClick($sObj)
EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0