WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: LinkedIn hResume] hResume Customizations (5 posts)

  1. swosko
    Member
    Posted 5 years ago #

    I just wanted to say great job on the plugin. I took the liberty to add a few new features on my site, wosko.us.

    I went looking for a plugin awhile back to fulfill a simple requirement of mine - make it easy to keep my resume up to date. The hResume plugin has fulfilled this need. I had a few extra things I wanted to get out of it, such as export to PDF and experience tag clouds. These aren't, as far as I can tell, in the initial intentions of this plugin, but were beneficial to me.

    Nice job and thanks!

  2. ESiegel
    Member
    Posted 5 years ago #

    OK, I don't get it.
    I installed hResume. It's supposed to generate a new page. It doesn't. I checked out the tree structure of my blog. Nothing.
    Do you have any thoughts on the matter?

  3. Brad Touesnard
    Member
    Posted 5 years ago #

    @ESiegel Don't forget step #6 in the installation instructions:
    http://wordpress.org/extend/plugins/linkedin-hresume/installation/

  4. capnhairdo
    Member
    Posted 4 years ago #

    I second swosko's praise for your plug-in. Simple and straightforward, it was pretty much exactly what I needed for a client's site who just didn't want to have keep updating his résumé in so many places. He wanted to show his LinkedIn résumé almost verbatim, with just a couple of items removed, and your plug-in did this with the least meddling.

    Just a couple quick suggestions for possible enhancements:

    • Remove LinkedIn-specific stuff like "My connections" link.

    • Strip out the "more" and "less" links that may appear in Past Experience section of the Summary block.

    * Add some options for the output of the resume, such as showing or hiding certain block and individual elements (e.g. the Summary). Perhaps beyond the scope of this plug-in...

    * Consider adding a filter hook so people can do further modifications to the output code. Something like this:

    function lnhr_stripout_hresume($content) {
    ...
      $hresume = apply_filters( 'lnhr_resume', $hresume );
      return $hresume;
    }

    For my purposes, I added the filter hook mentioned above and then did some further parsing outside the plug-in to remove unwanted elements. I used PHP DOMDocument to convert the résumé so I could find and remove nodes without complicated regexes (why don't more people do this?).

    // tidy up output of LinkedIn hResume plug
    add_filter('lnhr_resume', 'lnhr_tidy');
    
    function lnhr_tidy($content) {
      $doc = new DOMDocument("1.0", get_option('blog_charset'));
      $doc->loadHTML($content);
      $xpath = new DOMXPath($doc);
      DOMremoveHTMLElements($xpath, 'id', 'overview');
      DOMremoveHTMLElements($xpath, 'id', 'additional-information');
      DOMremoveHTMLElements($xpath, 'class', 'adr');
      DOMremoveHTMLElements($xpath, 'class', 'actions');
      DOMremoveHTMLElements($xpath, 'class', 'organization-details');
      DOMremoveHTMLTags($doc, 'hr');
      $content = preg_replace('%^.*<body>|</body>.*$%si', '', $doc->saveHTML());
      return $content;
    }
    
    function DOMremoveHTMLTags($doc, $search) {
      $tags = $doc->getElementsByTagName($search);
      $tagsToRemove = array(); // http://us2.php.net/manual/en/domnode.removechild.php#90292
      foreach ($tags as $tag) {
        $tagsToRemove[] = $tag;
      }
      foreach ($tagsToRemove as $tag) {
        $tag->parentNode->removeChild($tag);
      }
    }
    
    // http://www.php.net/manual/en/domdocument.getelementbyid.php#96500
    // http://us2.php.net/manual/en/domxpath.query.php
    function DOMremoveHTMLElements($xpath, $type, $search) {
      $elements = $xpath->query("//*[@$type='$search']");
      if (!is_null($elements)) {
        foreach ($elements as $element) {
          $element->parentNode->removeChild($element);
        }
      }
    }

    Cheers, and thanks again for the nice plug-in!

  5. HAMMADHASSAN
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic