• Hi,

    At http://martinrijlaarsdam.nl/website/?page_id=234 I display my CV via your plugin. Until some time ago this worked fine. I use the syntax below, but the positions do not show up while all other info displays fine.

    Any idea?

    Thanks!

    Regards,
    Martin

    ‘[linkedinsc profile=”martinrijlaarsdam” lang=”en”]
    <div style=”margin-top: 2px; float: right; width: 95px; margin-right: 0px;”><img src=”[linkedinsc_photo]” alt=”” align=”right” /></div>
    [linkedinsc_summary]

    [expand title=Experience tag=”h3″][linkedinsc_positions]
    <div style=”float: left; width: 150px;”>[linkedinsc_position_start_date] – [linkedinsc_position_end_date]</div>
    <div style=”margin-left: 150px;”>[linkedinsc_position_title], [linkedinsc_position_company_name]

    [linkedinsc_position_company_industry]

    [linkedinsc_position_summary]</div>
    [/linkedinsc_positions][/expand]

    [expand title=Education tag=”h3″][linkedinsc_edu]
    <div style=”float: left; width: 150px;”>[linkedinsc_edu_start] – [linkedinsc_edu_end]</div>
    <div style=”margin-left: 150px;”>[linkedinsc_edu_title]

    [linkedinsc_edu_degree] in [linkedinsc_edu_major]

    [linkedinsc_edu_notes]</div>
    [/linkedinsc_edu][/expand]

    [expand title=”Publications” tag=”h3″]

    Please see the publication page for a list of publications and links[/expand]

    [expand title=”Interests and Honors” tag=”h3″]
    <div style=”float: left; width: 150px;”>Honors</div>
    <div style=”margin-left: 150px;”>[linkedinsc_honors]</div>
    <div style=”float: left; width: 150px;”>Interests</div>
    <div style=”margin-left: 150px;”>[linkedinsc_interests]</div>
    [/expand][/linkedinsc]’

    http://wordpress.org/extend/plugins/linkedin-sc/

Viewing 15 replies - 1 through 15 (of 15 total)
  • I have the same problem and no solution.
    Copied and pasted the code from the wordpress-plugin page, but it doesn’t work.

    Every other code works fine, only positions is broken.

    Noticed the same thing,

    After some research i saw linkedin updated their HTML of the public profile and changed a small piece of there class.

    All you need to do i open is go to the plugin folder and open the file.

    folder : linkedin-sc/lib/linkedin_profile/linkedin_public_profile.php

    In the file go to line 169 and replace the code from 169 to 186 with this piece of code

    // Get positions
    $this->positions = array();
    foreach($this->_xml->xpath('//div[@class="position  first experience vevent vcard summary-current"]') as $experience) {
    	$exp = $this->fill_position($experience);
    	$this->positions[] = $exp;
    }
    foreach($this->_xml->xpath('//div[@class="position  first experience vevent vcard summary-past"]') as $experience) {
    	$exp = $this->fill_position($experience);
    	$this->positions[] = $exp;
    }
    foreach($this->_xml->xpath('//div[@class="position   experience vevent vcard summary-current"]') as $experience) {
    	$exp = $this->fill_position($experience);
    	$this->positions[] = $exp;
    }
    foreach($this->_xml->xpath('//div[@class="position   experience vevent vcard summary-past"]') as $experience) {
    	$exp = $this->fill_position($experience);
    	$this->positions[] = $exp;
    }

    Hi RobotJoosen,

    thanks a lot for debugging. It works… partially.
    Date, title and company are displayed. But company industry and summary are hidden. Look at my page: http://www.startupnavigator.de/christian-kramer/vita/

    Thanks for your work.
    CK

    Hej Chris,

    I see the problem and i’m trying to fix it, hopefully tonight.

    Greets,

    Robot Joosen

    Hello again,

    For this one you need to open the following file:

    Path : linkedin-sc/inc/linkedin-sc-experiences.php

    and replace the code from line 201 to 229 with the following code

    private function fill_position($experience) {
    		$exp = new stdClass();
    		$exp->title = trim($experience->div->h3->span);
    		$exp->company = new stdClass();
    		if($experience->div->h4->strong->a) {
    			$exp->company->name = trim($experience->div->h4->strong->a->span);
    			$exp->company->link = $experience->div->h4->strong->a['href'];
    		} else {
    			$exp->company->name = trim($experience->div->h4->strong->span);
    		}
    		foreach($experience->xpath('.//p[contains(@class, "orgstats organization-details")]') as $sector) {
    			$s = explode(';', $sector[0]);
    			$c = count($s) - 1;
    			$exp->company->industry = $s[$c];
    		}
    		foreach($experience->xpath('.//abbr[@class="dtstart"]') as $start) {
    			$exp->start_date = $start['title'];
    		}
    		foreach($experience->xpath('.//abbr[@class="dtend"]') as $end) {
    			$exp->end_date = $end['title'];
    		}
    		foreach($experience->xpath('.//span[@class="duration"]') as $end) {
    			$exp->duration = $end->span['title'];
    		}
    		foreach($experience->xpath('.//p[contains(@class, " description")]') as $description) {
    			$exp->summary = $this->subXML($description->asXML());
    		}
    		return $exp;
    	}

    I honestly think there are a lot more things broken but this will fix it for now…

    Greets,

    Robot Joosen

    The code above shows the industry as “Marketing and Advertising Industry”. I personally don’t like that so this code remove it.

    private function fill_position($experience) {
    		$exp = new stdClass();
    		$exp->title = trim($experience->div->h3->span);
    		$exp->company = new stdClass();
    		if($experience->div->h4->strong->a) {
    			$exp->company->name = trim($experience->div->h4->strong->a->span);
    			$exp->company->link = $experience->div->h4->strong->a['href'];
    		} else {
    			$exp->company->name = trim($experience->div->h4->strong->span);
    		}
    		foreach($experience->xpath('.//p[contains(@class, "orgstats organization-details")]') as $sector) {
    			$s = explode(';', $sector[0]);
    			$c = count($s) - 1;
    			$n = substr($s[$c], 0 ,-17);
    			$exp->company->industry = $n;
    		}
    		foreach($experience->xpath('.//abbr[@class="dtstart"]') as $start) {
    			$exp->start_date = $start['title'];
    		}
    		foreach($experience->xpath('.//abbr[@class="dtend"]') as $end) {
    			$exp->end_date = $end['title'];
    		}
    		foreach($experience->xpath('.//span[@class="duration"]') as $end) {
    			$exp->duration = $end->span['title'];
    		}
    		foreach($experience->xpath('.//p[contains(@class, " description")]') as $description) {
    			$exp->summary = $this->subXML($description->asXML());
    		}
    		return $exp;
    	}

    Hi RobotJoosen,

    with your new codes I got an error message:
    Parse error: syntax error, unexpected ‘&’ in /home/www/wordpress/wp-content/plugins/linkedin-sc/lib/linkedin_profile/linkedin_public_profile.php on line 203

    Maybe it depends on $exp->title = trim($experience->div->h3->span);

    Any idea?

    Regards,
    CK

    Sorry, … my mistake: Copied the wrong code.

    But some rows are empty, although there are contents.
    Any idea?

    The rows that are empty because there is no data to retreive.

    When you look at “Inhaber” at macs & moritz, you can see that there is no industry.

    Greets,

    Roald Joosen

    But I stored at every entry an industry. At macs & moritz it’s the German “Unterhaltungselektronik”.
    Does it depend on the missing URL for company? I don’t think so.

    I hope you like code, though it is not a solution just the cause of your problem.

    The $exp->company->industry is filled with certain content from an element that has the partial class “orgstats organization-details”. If you look at the following code, extracted from your linkedin page you see the following difference in code

    <div>
        <div class="position   experience vevent vcard summary-past" style="display:block">
            <a class="include" href="#name"></a>
            <div class="postitle">
                <h3 class="false">
                    <strong class="title">
                        <a href="/search?search=&title=Inhaber&sortCriteria=R&keepFacets=true&currentTitle=C"
                        title="Find users with this title" name="title">Inhaber</a>
                    </strong>
                </h3>
                <h4>
                    <strong>
                        <a href="/search?search=&currentCompany=C&company=macs+%26+moritz&sortCriteria=R&keepFacets=true"
                        title="Find users who have worked at this company" name="company">macs & moritz</a>
                    </strong>
                </h4>
            </div>
            <p class="orgstats organization-details past-position"></p>
            <p class="period">
                <abbr class="dtstart" title="2006-11-01">November 2006</abbr>–
                <abbr class="dtend" title="2009-12-01">Dezember 2009</abbr>
                <span class="duration">
                    <span class="value-title" title="P3Y2M"></span>(3 Jahre 2 Monate)</span>
                <span class="location">Freising</span>
            </p>
            <p class=" description past-position">Handel mit Apple-Produkten (Hardware, Software)</p>
        </div>
    </div>

    And

    <div>
        <div class="position   experience vevent vcard summary-current" style="display:block">
            <a class="include" href="#name"></a>
            <div class="postitle">
                <h3 class="false">
                    <strong class="title">
                        <a href="/search?search=&title=Vorstand&sortCriteria=R&keepFacets=true&currentTitle=C"
                        title="Find users with this title" name="title">Vorstand</a>
                    </strong>
                </h3>
                <h4>
                    <strong>
                        <span class="miniprofile-container /companies/1813444?miniprofile=" data-tracking="mcp_profile_sum"
                        data-li-getjs="http://s3.licdn.com/scds/concat/common/js?h=6d023c73nq51qkuo996rvg3t8">
                            <strong>
                                <a class="company-profile" href="/company/1813444?trk=pro_other_cmpy"><span class="org summary">Gewerbeverband Freising im Bund der Selbständigen Bayern e.V.</span></a>
                            </strong>
                        </span>
                    </strong>
                </h4>
            </div>
            <p class="orgstats organization-details current-position">Branche: Management von Nonprofit-Organisationen</p>
            <p class="period">
                <abbr class="dtstart" title="2007-11-01">November 2007</abbr>–
                <abbr class="dtstamp" title="2012-02-20">Aktuell</abbr>
                <span class="duration">
                    <span class="value-title" title="P4Y4M"></span>(4 Jahre 4 Monate)</span>
            </p>
            <p class=" description current-position">Ressort Organisation & Öffentlichkeitsarbeit</p>
        </div>
    </div>

    The first code block show that following element is empty. (this contains the partial class “orgstats organization-details”.
    <p class="orgstats organization-details past-position"></p>

    in the second block you can see that the same element has content.
    <p class="orgstats organization-details current-position">Branche: Management von Nonprofit-Organisationen</p>

    So even if you have stored the industry, for me and the plugin it is not visible. I don’t have a solution for this problem. But i think the solution is in your LinkedIn profile.

    Greets,

    Roald Joosen

    p.s. maybe the language choice (german over english) might be the problem, as you can see it has branche at the front instead of industry at the end. I’m not sure about this but maybe you could try the first code and see if there is any difference. Also the explode might screw up some things because of the langauge. Not sure but it might be something, no time to check, got to get be to work.

    So you need to do some copy pasting, the way i’ve treaded the plugin wasn’t how it should be and i think this should work beter. Still this won’t solve the empty branche/industry slots.

    Replace in file linkedin-sc/inc/linkedin-sc-experiences.php line 86 to 91 with:

    function linkedin_sc_position_company_industry_handler($atts) {
    	$exp = _linkedin_sc_get_exp();
    	if(strpos($exp->company->industry,'industry')!==false) $exp->company->industry = str_replace('industry','',$exp->company->industry);
    	if(strpos($exp->company->industry,'Branche:')!==false) $exp->company->industry = str_replace('Branche:','',$exp->company->industry);
    	return _linkedin_sc_format_text($exp->company->industry);
    }

    In the same file replace line 117 to 120 with :

    function linkedin_sc_position_summary_handler($atts) {
    	$exp = _linkedin_sc_get_exp();
    	if(isset($exp->summary)) return _linkedin_sc_format_text($exp->summary);
    }

    Replace in file linkedin-sc/inc/linkedin-sc-education.php line 72 with :
    if(isset($edu->degree)) return _linkedin_sc_format_text($edu->degree);

    Replace in file linkedin-sc/lib/linkedin_profile/linkedin_public_profile.php line 211 to 214 with :

    foreach($experience->xpath('.//p[contains(@class, "orgstats organization-details")]') as $sector) {
    			$s = explode(';', $sector[0]);
    			$exp->company->industry = (isset($s[2])) ? $s[2] : '';
    		}

    This covers most of your problems, i think.

    Greets,

    Roald Joosen

    Hi RobotJoosen,
    I need some help. Basically I’ve 2 problems.

    First one: I can see the photo. I’ve a WordPress website with SSL certificate. When I post a CV with the “secure post” property on, I can’t see the photo. But if I change this property to “off”, the photo is show. Looking at the source code of the page, I see that when I’ve the “secure post” property to on, the url for the photo is a “HTTPS//…” and this is the reason why the link is broken.
    Can I force the url for the photo to “HTTP//”?

    Second one: I’ve the LinkedIn API installed (I’ve my API and secrect keys), but I can’t see my Computer and Languages Skills. I can see only the shortcodes. There is something more that I must do or some setting to change to see the computer and languages skills?

    Thank for your help,

    Marcelino

    Hi Marcelino,

    I’m not sure about your first problem, but you can always try. If you have the URL you could do something like this.

    $new_url = str_replace('https://','http://',$old_url);

    Your second problem is something i can’t test and answer because i haven’t used the LinkedIn API.

    Greets,

    Roald Joosen

    Hi Roald,
    Thank you for your response. It doesn’t work. I tried the same solution yesterday, but the system always change from http to https.
    I’ve another problem: I can’t display the headline ([linkedinsc_headline]) and also I can’t display the location name ([linkedinsc_location_name]).
    Any idea?
    Thanks!!!
    Marcelino

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: LinkedIn SC] Positions not retrieved’ is closed to new replies.