Solution 339811

Submitted on 25 Oct 2013 by Mehmet OZC
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% % My code is below, it's used to generate the expected result. %Read in the player page playerPage=urlread(''); %Find where the web address for each profile starts startIdx=strfind(playerPage,'<div class="grid_53 push_3">')+104; %Initialize output array emails={}; %Get top 5 only for i=1:5 % Get the profile page link tempStr=playerPage(startIdx(i):startIdx(i)+100); quoteIdx=strfind(tempStr,'"')-1; profilePageLink=['' tempStr(1:quoteIdx(1))]; profilePage=urlread(profilePageLink); % Try and find mailto link tStartIdx=strfind(profilePage,'mailto'); %If you could find it if ~isempty(tStartIdx) % Get the email tEndIdx=strfind(profilePage(tStartIdx:tStartIdx+100),'"')+tStartIdx; % Add it to our cell array emails{length(emails)+1}=profilePage(tStartIdx+7:tEndIdx-2); end end tic yourResponse=getCodyEmails() timeElapsed=toc assert(isequal(yourResponse,emails)) assert(isequal(1,timeElapsed>3))
ans = 1 yourResponse = '' '' [1x23 char] [1x30 char] timeElapsed = 6.9150