WordPress.org

Ready to get started?Download WordPress

Forums

  1. dianaascher
    Member
    Posted 1 year ago #

    Hi there,

    If I can get your plugin to do what I need, it will be a lifesaver! I'm creating faculty pages for 100 people. I want to pull the first paragraph from each of their university websites into my site dynamically so I won't have to do any updating. I'm having a hard time choosing where to start and stop in a way that will apply across all the different sites. So far, I've managed to get the program to start at the professor's name (I have to hard-code this) and tried to make it stop at the last three words of the paragraph, but it keeps going.

    What do you advise?

    Many thanks,
    Diana

    http://artemisediting.com/eric-johnson/

    http://www4.gsb.columbia.edu/cbs-directory/detail/494930/Eric+Johnson

    http://wordpress.org/extend/plugins/shortcurl/

  2. Eli
    Member
    Plugin Author

    Posted 1 year ago #

    I like to use the HTML code on the source page for start and stop markers. Maybe use:
    start='<h2 class="teaching-and-research-interest"' stop='</p'

    also, just a tip for testing, I usually wrap the shortcode in a textarea so that I can see the HTML code that would be out put, then delete it when the output looks right.

    Hope that helps.

    Aloha, Eli

  3. dianaascher
    Member
    Posted 1 year ago #

    Hi Eli,

    Is there a way to get the shortcode to ignore styling in the external webpage? Any divs or property styles affect the rest of the content on my page....

    http://artemisediting.com/behavioral-science-policy/policy-areas-2/health/henry-aaron/

    Thank you for your help!

    Diana

  4. Eli
    Member
    Plugin Author

    Posted 1 year ago #

    It looks like the the HTML is picking up it's formatting from the style tags in the header of your site. I might be best to just alter the output that you are bringing in so that it does not match those styles defined in your header.

    For example, if you don't want those H3 tags that say "Contact" and "Resources" to be blue gradient bars, you could just change them to an H2 or H1 by adding this to your shortcode call:

    replace='h3>' with='h2>'
  5. dianaascher
    Member
    Posted 1 year ago #

    I don't want that content to show up at all. I set the stop before that content, but it keeps going, pops my divs out of whack, and overrides styling. I think the html is picking up the style tags from the external content, rather than from my code.

  6. Eli
    Member
    Plugin Author

    Posted 1 year ago #

    Can you paste your whole shortcode in here so I can test what content it gets?

  7. dianaascher
    Member
    Posted 1 year ago #

    Sure!

    I've tried it both of these ways (because I don't really know what the whole replace extend thing is):

    1.
    [remote_get url="http://www.brookings.edu/experts/aaronh?view=bio" start="Henry J. Aaron is" stop="/p>He is a member" replace="='/extend" with="='http://wordpress.org/extend" replace2="%2Fextend%2F" with2="http%3A%2F%2Fwordpress.org%2Fextend%2F"]

    2.
    [remote_get url="http://www.brookings.edu/experts/aaronh?view=bio" start="Henry J. Aaron is" stop="/p>He is a member"]

  8. dianaascher
    Member
    Posted 1 year ago #

    Removed the / in the stop statement, but it still creates the div and pops the sidebar under the page.

    [remote_get url="http://www.brookings.edu/experts/aaronh?view=bio" start="Henry J. Aaron is" stop="p>He is a member" replace="='/extend" with="='http://wordpress.org/extend" replace2="%2Fextend%2F" with2="http%3A%2F%2Fwordpress.org%2Fextend%2F"]

  9. Eli
    Member
    Plugin Author

    Posted 1 year ago #

    ok, well the first issue is that it is not stopping where you want it to because it is a p tag, not a /p tag, before the words "He is a member".

    Also, there are some messy /div endings in the middle of this content and a couple of div tags after that so be sure to open all the tags that this content wants to close before calling the shortcode, and close all the tags that that this content open after the shortcode or you will have some pretty bad HTML formatting on this page.

    Something like this should be close to what you want:

    <div><noindex><div><div>
    [remote_get url="http://www.brookings.edu/experts/aaronh?view=bio" start="Henry J. Aaron is" stop="p>He is a member"]
    /div></div>

    Note: my first /div after the shortcode does not have a < because the parsed content already ends with that character.

    Let me know how that works for you.

    Aloha, Eli

  10. dianaascher
    Member
    Posted 1 year ago #

    Ahh. Okay. I had fixed the /p thing, but it looks like whatever bad HTML exists in the pages I call out to will have to be fixed ahead of time. So it's not really scalable to do for 100 profiles from different institutions, huh?

    I really appreciate your help.

  11. Eli
    Member
    Plugin Author

    Posted 1 year ago #

    Not if the pages are all formatted differently.

    Are there no similarities across the board that you can use?

    I know all the pages will have a body and /body in them but you probably don't want to get the whole page, right?

    The other thing to watch out for is that if the page is updated and the marks you are looking for change then your parsing will fail and your page will be all broken looking. There may not be a good automated approach here.

  12. dianaascher
    Member
    Posted 1 year ago #

    Yeah. All the pages are from different institutions. I guess I could pull from body to /body, but I think that will bring too much content into the page and each person has different content types.

    I really appreciate your help. I'll have to start copying and pasting.... :-)

    I think your plugin is awesome, though. My case is just unusual.

  13. Eli
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. I set the status of this topic to closed, but do let me know if you ever need more help with it.

    Aloha, Eli

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic